Add permissions
Table of contents
Permissions are the actions that a user with specific role is allowed to perform within a specific resource. Sol Cerberus defines the permissions using sets of Rules, which are combinations of the three:
Role->Resource->Permission
How to add permissions
There are two ways to add permissions:
Demo program example
Rules are easier to understand using our demo program as an example.
We created 3 roles:
SquareMasterCircleMasterTriangleMaster
3 resources:
SquareCircleTriangle
And the Add, Update and Delete permissions for each role’s corresponding resource:
| Role | Resource | Permission |
|---|---|---|
SquareMaster | Square | Add |
SquareMaster | Square | Edit |
SquareMaster | Square | Delete |
CircleMaster | Circle | Add |
CircleMaster | Circle | Edit |
CircleMaster | Circle | Delete |
TriangleMaster | Triangle | Add |
TriangleMaster | Triangle | Edit |
TriangleMaster | Triangle | Delete |
Temporary Permissions
Sol Cerberus supports temporary permissions. Adding an expiring date when adding permissions will make the permissions effective only until the provided date.
Wildcards
Resource and Permission can be replaced by the wildcard character * to represent all resources or permissions, for instance:
SquareMaster->Square->*(all permission on resourceSquarefor theSquareMasterrole)SquareMaster->*->*(all permission on all resources for theSquareMasterrole)