Check User Operation Permissions on a Creatio Freedom UI Page

To access Operation permissions for a user in a Creatio Freedom UI page, there is a simple, built-in module you can use that is available in the new Creatio DevKit SDK that can be used in Freedom UI pages.

To use this devkit, you’ll need to add “@creatio-devkit/common” to the modules list of your page. This will look like this (note the “@creatio-devkit/common” in the square brackets and the sdk without quotes in the parenthesis):

define("UsrMyCustomEntity_FormPage", /**SCHEMA_DEPS*/["@creatio-devkit/common"] /**SCHEMA_DEPS*/, 
function/**SCHEMA_ARGS*/(sdk)/**SCHEMA_ARGS*/ {
	return {
		// ... the rest of the page here
	};
});

Now, with that module available, you can access things in the SDK, such as the RightsService. You’ll need to create an instance, and can then use it to check various operations permissions. Note, it does this check based on the user where the code is executing automatically. For example, to check if the current user can import from Excel:

const rightsService = new sdk.RightsService();

const canImportFromExcel = await rightsService.getCanExecuteOperation("CanImportFromExcel");
if (canImportFromExcel) {
	// user can import from Excel
}
ABOUT THE AUTHOR

Ryan Farley

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!