Question

Check permission to a operation in client code

Hello!

 

I have a question regarding system operation permissions. My goal is to find out if the current user has a specific operation permission. In order to do that within a business process, I've used the template from the marketplace with success. I'd like to do the same in client-code, for example in the Javascript code of an object page – ultimately I want to show some specific buttons only if the current user has specific operation permissions.

 

How can I achieve this?

 

Kind regards

Kai

Like 0

Like

2 comments
Best reply

Hi Kai, 



you can use such code in onEntityInitialized method

RightUtilities.checkCanExecuteOperation({operation: "UsrYourOperationPermission"}, function(result) {
		this.set("UsrYourAttribute", result);
}, this);

Then use this Attribute in Business rules or anywhere else.



And use "RightUtilities" in page definition as well:

 

define("OpportunityPageV2", [ "RightUtilities"], function(RightUtilities) {...

Kind regards,

Vladimir

Hi Kai, 



you can use such code in onEntityInitialized method

RightUtilities.checkCanExecuteOperation({operation: "UsrYourOperationPermission"}, function(result) {
		this.set("UsrYourAttribute", result);
}, this);

Then use this Attribute in Business rules or anywhere else.



And use "RightUtilities" in page definition as well:

 

define("OpportunityPageV2", [ "RightUtilities"], function(RightUtilities) {...

Kind regards,

Vladimir

Vladimir Sokolov,

Great, thank you!

Show all comments