Skip to main content
19-Tanzanite
July 8, 2024
Solved

SetEntityPermission removes existing UserGroup permissions

  • July 8, 2024
  • 1 reply
  • 1003 views

Hi Community,

 

I'm trying to set RunTimePermission for project entities using below code

let params = {
	allow: true /* BOOLEAN {"defaultValue":true} */,
	name: "UG2" /* STRING */,
	includeDependents: false /* BOOLEAN {"defaultValue":false} */,
	type: "Group" /* STRING */,
	projectName: "TestProject" /* PROJECTNAME */,
	tags: undefined /* TAGS */
};

// no return
Resources["EntityServices"].SetEntityPermission(params);

 

When we execute this service it removes existing UserGroup permission from entity.

 

Is this a bug or I'm doing something wrong here. 

 

TWX Version : 9.4.1

 

/VR

Best answer by Rocko

have you checked using AddResourceEntityPermission instead?

1 reply

Rocko
Rocko19-TanzaniteAnswer
19-Tanzanite
July 8, 2024

have you checked using AddResourceEntityPermission instead?

Velkumar19-TanzaniteAuthor
19-Tanzanite
July 8, 2024

Hi @Rocko 

 

AddResourceEntityPermission works properly. 

 

/VR

Rocko
19-Tanzanite
July 8, 2024

Does that solve the issue for you? I mean SetEntityPermission expects all permissions to be included in the parameters and overrides existing values. To set individual privileges, use the Add and Delete services. You could create a case for clarification though.