Roles¶
The Roles configuration section allows you to define all the Roles available for your Application. These Roles can be then used in any part of your Application, either in a standalone mode or extending the Permissions of a user, to add a Role-Based Access Control.
For example, you can use your defined roles
- inside your forms to add Role-Based Access Controls to whole pages, specific controller actions and/or operations and logic
- in Business Objects Operations, to define how they will be fetched or saved based on the specified Access Controls
- and any place else you need to restrict the access to your data and operations
Adding Roles¶
To add a new Role, click the + button under the list of roles. Next,
- Give this Role a Unique name
- Add a Description so that the other members of your Team understand more about this Role
- Assign one or more Permissions under this Role, so that everything that is allowed by the Permission, be allowed to the Role as well
A new application has one role, Administrator, with the permissions ManageUsers, ManageRoles, ManagePermissions, ManageOperations, ManageSettings and ManageApplicationData. The page also shows the code that reads a role, Application.Roles.Administrator.
Info
You can access a Role using mamba code with the following syntax: Application.Roles.Role_Name
Usage¶
As soon as you have defined a set of Roles, you can use them in any Model you like. Unlike the Permissions that can be selected as Authorization Restrictions of specific Controller Actions in a form (see Permissions), the Roles of a User are available only via Mamba.
To check whether a User has a specific role or not, using Mamba, you can access his/her object using the Domain.ApplicationUser class like this:
