Conversation
|
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. DetailsInstructions 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. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| ) | ||
| RESOURCE_TOOL_EXPORT = Permission( | ||
| group=Group.SYSTEM_RES_TOOL, operate=Operate.EXPORT, role_list=[RoleConstants.ADMIN], | ||
| parent_group=[SystemGroup.RESOURCE_TOOL], is_ee=settings.edition == "EE" |
There was a problem hiding this comment.
The provided code appears to be an enumeration of operation types and related permissions for different groups. However, there's one issue with the DEBUG operations being defined twice:
- In line 144, it defines
DEBUGas both a string literal"DEBUG"and as part of an enumeration valueOperate.DEBUG. - In line 314, it also defines
DEBUGagain within the functionget_workspace_role.
To resolve this duplication, you should remove the first instance of defining DEBUG as a string in the Enum. Here’s what the corrected section might look like:
@@ -144,7 +144,6 @@ class Operate(Enum):
USE = "USE"
IMPORT = "READ+IMPORT"
EXPORT = "READ+EXPORT" # 导入导出
SYNCHRONIZE = "READ+SYNC" # 同步
GENERATE = "READ+GENERATE" # 生成
ADD_MEMBER = "READ+ADD_MEMBER" # 添加成员
@@ -314,7 +313,6 @@ def get_workspace_role(self):
GROUP.KNOWLEDGE_HIT_TEST.value: _("Hit-Test"),
OPERATE.IMPORT.value: _("Import"),
OPERATE.EXPORT.value: _("Export"),
OPERATE.SYNCHRONIZE.value: _("Sync"),
OPERATE.GENERATE.value: _("Generate"),
OPERATE.ADD_MEMBER.value: _("Add Member"),This will ensure that DEBUG is only defined once and used appropriately across the entire file.
feat: Remove debug