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
21 changes: 6 additions & 15 deletions ui/src/permission/model/system-manage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,12 @@ const systemManage = {
'OR',
),
create: () => false,
modify: () =>
hasPermission([
RoleConst.ADMIN,
PermissionConst.RESOURCE_MODEL_EDIT
],'OR'),
paramSetting: () =>
hasPermission([
RoleConst.ADMIN,
PermissionConst.RESOURCE_MODEL_EDIT
],'OR'),
delete: () =>
hasPermission([
RoleConst.ADMIN,
PermissionConst.RESOURCE_MODEL_DELETE
],'OR'),
modify: (id: string) =>
hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_EDIT], 'OR'),
paramSetting: (id: string) =>
hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_EDIT], 'OR'),
delete: (id: string) =>
hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_DELETE], 'OR'),

folderCreate: () => false,
folderEdit: () => false,
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.

There are no obvious issues in the provided code snippet. However, there is one minor improvement:

// Add type annotations to parameters
modify: (id: string) =>
  hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_EDIT], 'OR'),

paramSetting: (id: string) =>
  hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_EDIT], 'OR'),

delete: (id: string) =>
  hasPermission([RoleConst.ADMIN, PermissionConst.RESOURCE_MODEL_DELETE], 'OR');

Adding type annotations (string and Permission) helps clarify what the function expects as input and can enhance readability for other developers working with this code.

Expand Down
Loading