Skip to content

Commit

Permalink
HPC-9793: Add global DELETE_UPLOADED_FILE permission
Browse files Browse the repository at this point in the history
  • Loading branch information
enxtur committed Dec 2, 2024
1 parent e50fceb commit 7b97a9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/auth/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export const AUTH_PERMISSIONS = {
* Can add comments to any project
*/
ADD_COMMENT_TO_ANY_PROJECT: 'canAddCommentToAnyProject',
DELETE_UPLOADED_FILE: 'canDeleteUploadedFile',
},
operation: {
/**
Expand Down
3 changes: 3 additions & 0 deletions src/auth/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,19 @@ export const calculatePermissionsFromRolesGrant = async <
global.add(P.global.EDIT_ANY_MEASUREMENT);
global.add(P.global.CHANGE_ANY_PLAN_VISIBILITY_IN_PROJECTS);
global.add(P.global.DELETE_ANY_PLAN);
global.add(P.global.DELETE_UPLOADED_FILE);
} else if (role === 'ftsAdmin') {
// New Permissions
global.add(P.global.VIEW_ANY_FLOW);
global.add(P.global.EDIT_ANY_FLOW);
global.add(P.global.EDIT_CATEGORIES);
global.add(P.global.VIEW_CATEGORIES);
global.add(P.global.DELETE_UPLOADED_FILE);
} else if (role === 'projectsAdmin') {
// New Permissions
global.add(P.global.PROJECT_WORKFLOW_MOVE_TO_ANY_STEP);
global.add(P.global.ADD_COMMENT_TO_ANY_PROJECT);
global.add(P.global.DELETE_UPLOADED_FILE);
} else if (role === 'swaps') {
global.add(P.global.MODIFY_OPERATION_ACCESS_AND_PERMISSIONS);
global.add(P.global.ADD_OPERATION);
Expand Down

0 comments on commit 7b97a9d

Please sign in to comment.