Skip to content

Commit

Permalink
Merge pull request #210 from UN-OCHA/HPC-9824
Browse files Browse the repository at this point in the history
HPC-9824: Coordinating organization information gets deleted from plan details
  • Loading branch information
enxtur authored Jan 27, 2025
2 parents 2586826 + 2c69630 commit 2de913a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unocha/hpc-api-core",
"version": "10.9.0",
"version": "10.10.0",
"description": "Core libraries supporting HPC.Tools API Backend",
"license": "Apache-2.0",
"private": false,
Expand Down
4 changes: 4 additions & 0 deletions src/auth/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export const AUTH_PERMISSIONS = {
*/
ADD_COMMENT_TO_ANY_PROJECT: 'canAddCommentToAnyProject',
DELETE_UPLOADED_FILE: 'canDeleteUploadedFile',
CHANGE_ANY_PLAN_STATE_FORWARD: 'canChangeAnyPlanStateForward',
CHANGE_ANY_PLAN_STATE_BACKWARD: 'canChangeAnyPlanStateBackward',
},
operation: {
/**
Expand Down Expand Up @@ -193,6 +195,8 @@ export const AUTH_PERMISSIONS = {
* Can add comment to any project under this plan
*/
ADD_COMMENT_TO_PROJECTS: 'canAddCommentToProjects',
CHANGE_PLAN_STATE_FORWARD: 'canChangePlanStateForward',
CHANGE_PLAN_STATE_BACKWARD: 'canChangePlanStateBackward',
},
project: {
MODIFY_ACCESS_AND_PERMISSIONS: 'canModifyAccessAndPermissions',
Expand Down
4 changes: 4 additions & 0 deletions src/auth/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ export const calculatePermissionsFromRolesGrant = async <
global.add(P.global.CHANGE_ANY_PLAN_VISIBILITY_IN_PROJECTS);
global.add(P.global.DELETE_ANY_PLAN);
global.add(P.global.DELETE_UPLOADED_FILE);
global.add(P.global.CHANGE_ANY_PLAN_STATE_FORWARD);
global.add(P.global.CHANGE_ANY_PLAN_STATE_BACKWARD);
} else if (role === 'ftsAdmin') {
// New Permissions
global.add(P.global.VIEW_ANY_FLOW);
Expand Down Expand Up @@ -291,6 +293,8 @@ export const calculatePermissionsFromRolesGrant = async <
planSet.add(P.plan.CLONE_PROJECTS);
planSet.add(P.plan.MAKE_VISIBLE_IN_PROJECTS);
planSet.add(P.plan.ADD_COMMENT_TO_PROJECTS);
planSet.add(P.plan.CHANGE_PLAN_STATE_FORWARD);
planSet.add(P.plan.CHANGE_PLAN_STATE_BACKWARD);
}
}
} else if (grant.type === 'project') {
Expand Down

0 comments on commit 2de913a

Please sign in to comment.