Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/common/auth/constants/permission_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ class PermissionConstants(Enum):
PermissionMeta(
role_list=[RoleConstants.WORKSPACE_MANAGE, RoleConstants.USER],
category=Category.WORKSPACE,
resource_permission_group_list=[ResourcePermissionConst.KNOWLEDGE_VIEW],
resource_permission_group_list=[ResourcePermissionConst.KNOWLEDGE_MANAGE],
scope=[PermissionScopeConstants.WORKSPACE, PermissionScopeConstants.WORKSPACE_RESOURCE],
),
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff shows a single-line change: KNOWLEDGE_VIEW is replaced with KNOWLEDGE_MANAGE in the resource_permission_group_list of a PermissionMeta entry.

Observations / potential issues:

  1. Permissions escalation. Swapping VIEW → MANAGE grants broader capabilities (manage/edit/delete) rather than read-only access. Verify this is intentional and that the permission name/key mapping remains consistent elsewhere (e.g., any hardcoded references to this meta, ACL seed data, or tests).

  2. Semantic mismatch. The enum being modified has role_list=[WORKSPACE_MANAGE, USER]. If a USER role now carries a MANAGE-level resource permission group, confirm that's the desired authorization model — otherwise it may leak elevated privileges to regular users.

  3. Scope alignment. The entry lists both WORKSPACE and WORKSPACE_RESOURCE scopes. Ensure the KNOWLEDGE_MANAGE group is valid for both scopes; some management permissions may only make sense at resource scope, not workspace scope.

  4. Missing view permission. Replacing rather than adding means callers relying on KNOWLEDGE_VIEW from this entry will lose it. Check whether VIEW is still granted through another meta group; otherwise read-only users could be locked out.

  5. Test coverage. Update/add tests asserting the expected permission set for this meta, since no test diff is included.

  6. Naming consistency (minor optimization). The reference uses ResourcePermissionConst while the visible class prefix in context is PermissionConstants; ensure imports/aliases are correct so the constant resolves as intended.

Recommendation: Confirm intent with the ticket/PR description, verify downstream consumers and ACL seeds, and add a regression test for the resulting permission set.

Expand Down
Loading