Update Project Permissions Using Fusion | Community
Skip to main content
CrisDonaldson
Level 3
July 25, 2023
Solved

Update Project Permissions Using Fusion

  • July 25, 2023
  • 1 reply
  • 1399 views

Is there a way to update Project permissions to give a User View access to a Project using Fusion? For example, I want to read a User ID and give that User access to View a specific Project.

 

Thanks for the help.

Cristina

Best answer by ChrisStephens

Yes, that is possible.

 

You have to pull in the current access rules for the project, create the new access rule, add the new rule to the existing rules array, and then PUT the array back onto the project.

1. Current access rules: GET call, field = accessRules:*

2. Create a collection including:

 • coreAction (string, the permission you want to grant, in this case VIEW),

• objCode (string) = ACSRUL,

• accessorID (string, ID of object you are granting access, i.e. user), 

• securityObjID (string, ID of the object whose permission you are changing, in this case project ID)

• accessorObjCode (string, object code you are granting access, i.e. user)

• securityObjCode (string, object code you are adding the permission to, PROJ in this case)

• forbiddenActions (array of strings, actions which are forbidden)

• secondaryActions (array of strings, actions which are permitted)

3. Merge 1 and 2 into a single array

4. PUT call to {objCode}/{ID}/?fields=accessRules, include array from 3 in body as json string

1 reply

ChrisStephens
Community Advisor
ChrisStephensCommunity AdvisorAccepted solution
Community Advisor
July 25, 2023

Yes, that is possible.

 

You have to pull in the current access rules for the project, create the new access rule, add the new rule to the existing rules array, and then PUT the array back onto the project.

1. Current access rules: GET call, field = accessRules:*

2. Create a collection including:

 • coreAction (string, the permission you want to grant, in this case VIEW),

• objCode (string) = ACSRUL,

• accessorID (string, ID of object you are granting access, i.e. user), 

• securityObjID (string, ID of the object whose permission you are changing, in this case project ID)

• accessorObjCode (string, object code you are granting access, i.e. user)

• securityObjCode (string, object code you are adding the permission to, PROJ in this case)

• forbiddenActions (array of strings, actions which are forbidden)

• secondaryActions (array of strings, actions which are permitted)

3. Merge 1 and 2 into a single array

4. PUT call to {objCode}/{ID}/?fields=accessRules, include array from 3 in body as json string

CrisDonaldson
Level 3
July 25, 2023

Fantastic, thanks so much!