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
}




Hi Ryan,
Works as expected! My question is, how about for Object permissions? Do you have a page code for checking User’s Object permission whether a user can view/edit/delete on the object?
Thank you
The model class does have functions fort canSave and canDelete to test for that. Last I tried those functions were not working and I had reported to Creatio (they were incorrectly mapped in the sdk), but I haven’t tried recently. See https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/8.1/front-end-development/freedom-ui/data-sources/crud-operations/references/model-class-js
Ryan
FYI, canSave still dont work in 8.3.0.
That’s disappointing. Thanks Jérôme.
One workaround I use is using RightService that returns an Empty String if rights are ok:
canEdit: async function(request) {
const pds = await request.$context.getPrimaryModelName();
const schema = await request.$context.dataSchemas[pds];
var recordId = await request.$context.Id;
var payload = {
schemaName: schema.name,
primaryColumnValue: recordId
};
const httpService = new sdk.HttpClientService();
const response = await httpService.post(“rest/RightsService/GetCanEdit”, payload);
return (response.body.GetCanEditResult == “”);
},
That’s a great idea. Good to know that way works. Thanks Jérôme.