feat(settings): granular per-subpage permissions and grouped permissions UI#430
Open
larsgeorge-db wants to merge 1 commit into
Open
feat(settings): granular per-subpage permissions and grouped permissions UI#430larsgeorge-db wants to merge 1 commit into
larsgeorge-db wants to merge 1 commit into
Conversation
…ons UI Refactor the Settings permission model from a single Admin-only flag into: - a layout-gate `settings` permission (None/RO/RW/Admin) controlling access to /settings and its sidebar - dedicated `settings-<name>` permissions for every Settings subpage (general, roles, git, ui, tags, connectors, mcp, jobs, search, delivery, semantic-models, certification-levels, data-domains, business-roles, delivery-methods, asset-types, teams, projects, audit, workflows) Permissions are now grouped (Discover / Build / Govern / Deploy / Settings / Other) in the Role editor, mirroring the main sidebar for easier navigation. Backend exposes the new `group` field via SettingsManager.get_features_with_access_levels, and an idempotent startup seeder grants the built-in Admin role Admin on every new `settings-*` ID so existing deployments work without manual reconfiguration. Frontend SettingsLayout and SettingsPageWrapper now AND-gate access on both the parent `settings` permission and the per-subpage permission, and correctly wait for the permissions store to initialize before deciding whether to redirect (fixes a race where the layout would bounce to / on first mount). Implements #427.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Refactors the Settings permission model from a single Admin-only flag into a two-level scheme and groups permissions in the Role editor for easier navigation. Closes #427.
Permission model
settingspermission (None/Read-only/Read/Write/Admin) controls access to/settingsand its sidebar.settings-<name>permission (None / RO / RW / Admin):settings-general,settings-roles,settings-git,settings-ui,settings-tags,settings-connectors,settings-mcp,settings-jobs,settings-search,settings-delivery,settings-semantic-models,settings-certification-levels,settings-data-domains,settings-business-roles,settings-delivery-methods,settings-asset-types,settings-teams,settings-projects,settings-audit,settings-workflows.Grouped permissions UI
The Role editor now groups feature permissions into Discover / Build / Govern / Deploy / Settings / Other, mirroring the main sidebar. Each feature carries a new
groupfield exposed fromSettingsManager.get_features_with_access_levels.Migration
An idempotent startup seeder (
SettingsManager.upgrade_admin_role_for_new_features) grants the built-in Admin roleAdminon every newsettings-*ID, so existing deployments work without manual reconfiguration.Backend route updates
settings_routes.py: added per-subpagePermissionCheckerto general/roles/search/git/delivery routes.workflows_routes.py,approvals_routes.py: switched from genericsettingstosettings-workflows.certification_levels_routes.py,connection_routes.py,mcp_tokens_routes.py: switched to their respectivesettings-*IDs.settings-*IDs are UI-only gates per the chosen approach in the PRD.Frontend
SettingsLayoutfilters the sidebar by per-subpage permission and redirects to/if the user lackssettingsRead-only.SettingsPageWrapperaccepts a new requiredpermissionIdprop and AND-gates with the layout permission._initAttempted/_isInitializing) before deciding to redirect, fixing a race where the layout would bounce to/on first mount.settingsRead-only.Test plan
test_settings_manager.py: 24/25 — one pre-existing unrelated failure).tsc --noEmitclean./settingsloads and auto-redirects to/settings/generalfor Admin user./settings/rolesloads with all 6 default roles.settings-generalRead-only sees just the General item in the sidebar and is denied for other subpages.settings: Noneis redirected from/settingsto/.