From 54c8cbf846f122f65912c8b440be16ce9944066c Mon Sep 17 00:00:00 2001 From: Convly Date: Fri, 1 Jul 2022 14:19:07 +0200 Subject: [PATCH 1/5] Fix i18n locale queries being forbidden even with the correct permission set --- packages/plugins/i18n/server/graphql.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/plugins/i18n/server/graphql.js b/packages/plugins/i18n/server/graphql.js index e6105196f0..983d3d55bd 100644 --- a/packages/plugins/i18n/server/graphql.js +++ b/packages/plugins/i18n/server/graphql.js @@ -66,6 +66,10 @@ module.exports = ({ strapi }) => ({ ...createLocalizationResolversConfig, // locale arg transformation for localized createEntity mutations ...getLocalizedCreateMutationsResolversConfigs({ typeRegistry }), + + // Modify the default scope associated to find and findOne locale queries to match the actual action name + 'Query.i18NLocale': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, + 'Query.i18NLocales': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, }, }; }); From 18e07d8d0fd73f8cbc318730aa268f13b3d30115 Mon Sep 17 00:00:00 2001 From: Convly Date: Thu, 1 Sep 2022 10:30:26 +0200 Subject: [PATCH 2/5] Update comment --- packages/plugins/i18n/server/graphql.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugins/i18n/server/graphql.js b/packages/plugins/i18n/server/graphql.js index 2d8bdafb98..e1a9f6780c 100644 --- a/packages/plugins/i18n/server/graphql.js +++ b/packages/plugins/i18n/server/graphql.js @@ -61,7 +61,8 @@ module.exports = ({ strapi }) => ({ // locale arg transformation for localized createEntity mutations ...getLocalizedCreateMutationsResolversConfigs({ typeRegistry }), - // Modify the default scope associated to find and findOne locale queries to match the actual action name + // NOTE: Modify the default scope associated to find and findOne locale queries to match the actual action name + // This imitate the REST behavior which works for U&P strategy and full access token but fail with read-only ones. 'Query.i18NLocale': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, 'Query.i18NLocales': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, }, From 7d5c1e9b21cfd430df2fee607b7a2c34dff931eb Mon Sep 17 00:00:00 2001 From: Convly Date: Thu, 1 Sep 2022 10:50:44 +0200 Subject: [PATCH 3/5] Revert add comment --- packages/plugins/i18n/server/graphql.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/plugins/i18n/server/graphql.js b/packages/plugins/i18n/server/graphql.js index e1a9f6780c..da94d825e5 100644 --- a/packages/plugins/i18n/server/graphql.js +++ b/packages/plugins/i18n/server/graphql.js @@ -62,7 +62,6 @@ module.exports = ({ strapi }) => ({ ...getLocalizedCreateMutationsResolversConfigs({ typeRegistry }), // NOTE: Modify the default scope associated to find and findOne locale queries to match the actual action name - // This imitate the REST behavior which works for U&P strategy and full access token but fail with read-only ones. 'Query.i18NLocale': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, 'Query.i18NLocales': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, }, From e82629705176a82ef1b100f4999a064458f37b56 Mon Sep 17 00:00:00 2001 From: Convly Date: Thu, 1 Sep 2022 10:54:32 +0200 Subject: [PATCH 4/5] Remove NOTE --- packages/plugins/i18n/server/graphql.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/i18n/server/graphql.js b/packages/plugins/i18n/server/graphql.js index da94d825e5..2d8bdafb98 100644 --- a/packages/plugins/i18n/server/graphql.js +++ b/packages/plugins/i18n/server/graphql.js @@ -61,7 +61,7 @@ module.exports = ({ strapi }) => ({ // locale arg transformation for localized createEntity mutations ...getLocalizedCreateMutationsResolversConfigs({ typeRegistry }), - // NOTE: Modify the default scope associated to find and findOne locale queries to match the actual action name + // Modify the default scope associated to find and findOne locale queries to match the actual action name 'Query.i18NLocale': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, 'Query.i18NLocales': { auth: { scope: 'plugin::i18n.locales.listLocales' } }, }, From beb512149ba9316f4c14b6de2e2f3f51cbcef4c3 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Thu, 1 Sep 2022 14:30:10 +0200 Subject: [PATCH 5/5] Only deploy gh pages on docs changes --- .github/workflows/pages.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 3f92ee00f4..877fdbc8f4 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -4,6 +4,8 @@ on: push: branches: - 'main' + paths: + - 'docs/**' workflow_dispatch: