Permission model, default roles and cache
What each kind of account may do, and how that is looked up quickly.
Documented design
- A catalog of permission groups and permission masters defines everything that can be granted.
- Roles for employees, customers and sub-accounts are built from that catalog, and default roles are created and synchronized per role type.
- A permission guard protects controller endpoints.
- An account's permission tree is cached in Redis, warmed at employee login and invalidated when a role's permissions change, a role is assigned or a token device is deactivated.
- A legacy rule model and the newer permission model coexist.
Permission group
A category of permissions
Permission master
One grantable permission
Role
A set of permissions
Account
Employee, customer or sub-account