diff --git a/src/auth/permissions.ts b/src/auth/permissions.ts index 57b805bd..010d7a4c 100644 --- a/src/auth/permissions.ts +++ b/src/auth/permissions.ts @@ -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: { /** diff --git a/src/auth/roles.ts b/src/auth/roles.ts index abd618f2..016b9fa5 100644 --- a/src/auth/roles.ts +++ b/src/auth/roles.ts @@ -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);