Security
Security service can be accessed via MainStore:
mainStore.security
It contains the methods to check whether the current user has a certain permission:
-
isOperationPermissionGranted
for entity operation permissions -
isAttributePermissionGranted
for entity attribute permissions -
isSpecificPermissionGranted
for specific permissions
See API documentation for more details.
Note that in most cases you shouldn’t need to check permissions manually. Instead you can use access control components to conditionally hide or disable content based on permissions:
-
EntityPermAccessControl when condition involves a single entity operation permission,
-
AttrPermAccessControl when condition involves a single entity attribute permission,
-
AccessControl when you have a complex condition.
API: Security.
See also: Security in Jmix.