This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
Changes to add client-setting as a scope type for client based settings #9214
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds client-setting as a scope. The settings button in admin panel can be enabled based on that and so does client settings and client theme on it.
🤖 Generated by Copilot at 1c53084
This pull request adds or updates the
scope
property for various admin routes and settings to allow for more fine-grained access control based on the user's scopes. It also refactors some code to use shared constants and adds a new migration file for the scope types.References
closes #insert number here
Explanation
🤖 Generated by Copilot at 1c53084
scope
property of theAdminRouteStateType
type to accept an array of strings (link)hasScope
variable inadminRoutes.tsx
to check for array values and find any matching scope from the user's scopes (link)scope
property of the setting items inSetting/index.tsx
to use array values where needed (link, link, link, link, link, link, link, link, link, link, link, link, link, link)settingItems
array inSetting/index.tsx
to check for array values and find any matching scope from the user's scopes (link)scope
property of thesettings
route inDefaultAdminRoutes.tsx
to use an array value (link, link)client-setting
scope value (link, link, link, link, link, link, link, link)clientSettingPath
constant from theclient-setting.schema
module inSetting/index.tsx
,DefaultAdminRoutes.tsx
,scope-type.seed.ts
, andclient-setting.hooks.ts
(link, link, link, link)clientSettingPath
constant as a scope value for some setting items and routes inSetting/index.tsx
andDefaultAdminRoutes.tsx
(link, link, link)clientSettingPath:read
andclientSettingPath:write
scope types to the database in20231106091534_client-setting-scope-type.ts
(link)clientSettingPath
constant as a type value for thesettings_client:read
andsettings_client:write
scope types inscope-type.seed.ts
(link)clientSettingPath
constant as a scope value for theverifyScope
hook inclient-setting.hooks.ts
(link)🤖 Generated by Copilot at 1c53084
QA Steps
List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.
Checklist