Skip to content

fix: Problem create permission#3984

Merged
zhanweizhang7 merged 1 commit intov2from
pr@v2@fix_problem_create_permission
Sep 2, 2025
Merged

fix: Problem create permission#3984
zhanweizhang7 merged 1 commit intov2from
pr@v2@fix_problem_create_permission

Conversation

@shaohuzhang1
Copy link
Copy Markdown
Contributor

fix: Problem create permission

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Sep 2, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Sep 2, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

PermissionConstants.KNOWLEDGE_PROBLEM_CREATE.get_workspace_permission_workspace_manage_role(),
RoleConstants.WORKSPACE_MANAGE.get_workspace_role(),
ViewPermission([RoleConstants.USER.get_workspace_role()],
[PermissionConstants.KNOWLEDGE.get_workspace_knowledge_permission()], CompareConstants.AND),
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 code provided has minor syntax issues that can be addressed:

  1. In the ViewPermission function, there is an error with the comparison operator. It should use CompareConstants.OR instead of CompareConstants.AND. Ensure proper case sensitivity when using constants like CompareConstants.

Here's the corrected line:

        ViewPermission([RoleConstants.USER.get_workspace_role()],
                     [PermissionConstants.KNOWLEDGE.get_workspace_knowledge_permission()], CompareConstants.OR),

Additionally, consider simplifying the logic for user permissions and roles to avoid unnecessary conditions. This might require rethinking how permission validation works within the system.

Overall, these changes will help ensure that the code runs without syntax errors and potentially improves its readability and maintainability.

@zhanweizhang7 zhanweizhang7 merged commit 1ec9186 into v2 Sep 2, 2025
3 of 6 checks passed
@zhanweizhang7 zhanweizhang7 deleted the pr@v2@fix_problem_create_permission branch September 2, 2025 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants