feat(access): persist personal navigation preferences

This commit is contained in:
2026-08-20 01:47:04 +02:00
parent 2be1dbc132
commit 5c6f446cd5
2 changed files with 29 additions and 0 deletions
@@ -991,6 +991,14 @@ def update_profile(
if payload.ui_preferences is None: if payload.ui_preferences is None:
next_settings["ui"] = UserUiPreferences().model_dump() next_settings["ui"] = UserUiPreferences().model_dump()
else: else:
if (
payload.ui_preferences.navigation is not None
and payload.ui_preferences.navigation.locked
):
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
detail="Personal navigation preferences cannot lock entries.",
)
next_ui = _user_ui_preferences(next_settings).model_dump() next_ui = _user_ui_preferences(next_settings).model_dump()
next_ui.update(payload.ui_preferences.model_dump(exclude_unset=True)) next_ui.update(payload.ui_preferences.model_dump(exclude_unset=True))
next_settings["ui"] = UserUiPreferences.model_validate(next_ui).model_dump() next_settings["ui"] = UserUiPreferences.model_validate(next_ui).model_dump()
+21
View File
@@ -639,6 +639,27 @@ ACCESS_DOCUMENTATION: tuple[DocumentationTopic, ...] = (
"verification": "The administration table shows the expected active credential count, last-use timestamp, revision, and audit events without exposing secret material.", "verification": "The administration table shows the expected active credential count, last-use timestamp, revision, and audit events without exposing secret material.",
}, },
), ),
DocumentationTopic(
id="access.reference.personal-navigation",
title="Personalize the side rail",
summary="Users can reorder or hide available navigation entries without changing access or other users' workspaces.",
body=(
"Open Settings and use the workspace navigation editor to move or show available entries. Personal order and visibility take precedence over tenant and system preferences. Entries locked by a system or tenant administrator remain visible, and a user cannot create a lock. Choosing the inherited order removes the personal layer. Module entitlement, View policy, and permissions continue to decide which destinations are available, so changing navigation never grants access."
),
layer="configured",
documentation_types=("user", "admin"),
audience=("user", "tenant_admin", "system_admin"),
order=85,
related_modules=("admin", "tenancy", "views"),
links=(
DocumentationLink(label="Workspace settings", href="/settings?section=workspace", kind="runtime"),
),
metadata={
"kind": "reference",
"help_contexts": ["core.settings.workspace"],
"outcome": "The user's side rail reflects the personal preference while locked and inaccessible entries remain governed by higher-level policy.",
},
),
DocumentationTopic( DocumentationTopic(
id="access.workflow.manage-sessions", id="access.workflow.manage-sessions",
title="Review and revoke account sessions", title="Review and revoke account sessions",