-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Remove debug permission #4067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,7 @@ const systemManage = { | |
| hasPermission( | ||
| [ | ||
| RoleConst.ADMIN, | ||
| PermissionConst.RESOURCE_TOOL_DEBUG, | ||
| PermissionConst.RESOURCE_TOOL_EDIT, | ||
| ], | ||
| 'OR', | ||
| ), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The proposed change seems to be addressing a typo in the permission requirement. Instead of However, I would recommend adding error handling or logging mechanisms around this logic if there are other permissions or roles involved that might affect system operations. Additionally, you could consider whether these changes need to impact other parts of the application or require additional testing before deployment. |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,6 @@ import {Permission, Role, Edition} from '@/utils/permission/type' | |
| // USE = "USE" | ||
| // IMPORT = "READ+IMPORT" | ||
| // EXPORT = "READ+EXPORT" # 导入导出 | ||
| // DEBUG = "READ+DEBUG" # 调试 | ||
| // SYNC = "READ+SYNC" # 同步 | ||
| // GENERATE = "READ+GENERATE" # 生成 | ||
| // ADD_MEMBER = "READ+ADD_MEMBER" # 添加成员 | ||
|
|
@@ -163,7 +162,6 @@ const PermissionConst = { | |
| SHARED_TOOL_DELETE: new Permission('SYSTEM_TOOL:READ+DELETE'), | ||
| SHARED_TOOL_IMPORT: new Permission('SYSTEM_TOOL:READ+IMPORT'), | ||
| SHARED_TOOL_EXPORT: new Permission('SYSTEM_TOOL:READ+EXPORT'), | ||
| SHARED_TOOL_DEBUG: new Permission('SYSTEM_TOOL:READ+DEBUG'), | ||
|
|
||
| SHARED_MODEL_READ: new Permission('SYSTEM_MODEL:READ'), | ||
| SHARED_MODEL_CREATE: new Permission('SYSTEM_MODEL:READ+CREATE'), | ||
|
|
@@ -213,7 +211,6 @@ const PermissionConst = { | |
| RESOURCE_TOOL_EDIT: new Permission('SYSTEM_RESOURCE_TOOL:READ+EDIT'), | ||
| RESOURCE_TOOL_READ: new Permission('SYSTEM_RESOURCE_TOOL:READ'), | ||
| RESOURCE_TOOL_DELETE: new Permission('SYSTEM_RESOURCE_TOOL:READ+DELETE'), | ||
| RESOURCE_TOOL_DEBUG: new Permission('SYSTEM_RESOURCE_TOOL:READ+DEBUG'), | ||
| RESOURCE_TOOL_IMPORT: new Permission('SYSTEM_RESOURCE_TOOL:READ+IMPORT'), | ||
| RESOURCE_TOOL_EXPORT: new Permission('SYSTEM_RESOURCE_TOOL:READ+EXPORT'), | ||
|
|
||
|
|
@@ -249,7 +246,6 @@ const PermissionConst = { | |
|
|
||
| RESOURCE_APPLICATION_READ: new Permission('SYSTEM_RESOURCE_APPLICATION:READ'), | ||
| RESOURCE_APPLICATION_EDIT: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+EDIT'), | ||
| RESOURCE_APPLICATION_DEBUG: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+DEBUG'), | ||
| RESOURCE_APPLICATION_IMPORT: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+IMPORT'), | ||
| RESOURCE_APPLICATION_EXPORT: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+EXPORT'), | ||
| RESOURCE_APPLICATION_DELETE: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+DELETE'), | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided TypeScript code is mostly clean but contains some stylistic adjustments that can be made to improve readability and maintainability. Here's a list of minor improvements:
Here’s the revised version with these changes: import { Permission, Role, Edition } from '@/utils/permission/type';
const PermissionConst = {
SHARED_TOOL_READ: new Permission('SYSTEM_TOOL:READ'),
SHARED_TOOL_CREATE: new Permission('SYSTEM_TOOL:READ+CREATE'),
SHARED_TOOL_IMPORT: new Permission('SYSTEM_TOOL:READ+IMPORT'),
SHARED_TOOL_EXPORT: new Permission('SYSTEM_TOOL:READ+EXPORT'),
- // SHARED_TOOL_DEBUG: new Permission('SYSTEM_TOOL:READ+DEBUG'), # This seems like an obsolete comment or commented out section
SHARED_MODEL_READ: new Permission('SYSTEM_MODEL:READ'),
SHARED_MODEL_CREATE: new Permission('SYSTEM_MODEL:READ+CREATE'),
SHARED_RESOURCE_TOOL_READ: new Permission('SYSTEM_RESOURCE_TOOL:READ'),
SHARED_RESOURCE_TOOL_CREATE: new Permission('SYSTEM_RESOURCE_TOOL:READ+CREATE'),
SHARED_RESOURCE_TOOL_EDIT: new Permission('SYSTEM_RESOURCE_TOOL:READ+EDIT'),
SHARED_RESOURCE_TOOL_DELETE: new Permission('SYSTEM_RESOURCE_TOOL:READ+DELETE'),
-// SHARED_RESOURCE_TOOL_DEBUG: new Permission('SYSTEM_RESOURCE_TOOL:READ+DEBUG'), # Also commented out or unused
SHARED_RESOURCE_TOOL_IMPORT: new Permission('SYSTEM_RESOURCE_TOOL:READ+IMPORT'),
SHARED_RESOURCE_TOOL_EXPORT: new Permission('SYSTEM_RESOURCE_TOOL:READ+EXPORT'),
RESOURCES_APP_READ: new Permission('SYSTEM_RESOURCE_APPLICATION:READ'),
RESOURCES_APP_EDIT: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+EDIT'),
RESOURCES_APP_DELETE: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+DELETE'),
};These changes make the code slightly more readable at first glance while keeping the logic intact. If you have specific areas within the |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided line of code seems to be checking permissions for accessing resource application debugging information. The change from
ResourceApplicationDebugtoResourceApplicationEditsuggests that the intended functionality is likely changing.Possible Issues:
Optimization Suggestions:
Overall, the line appears valid but may require some context-based justification or documentation updates.