Roles explanation needs to be better #334
Replies: 2 comments 3 replies
-
The permissions of a superuser may be defined by the developer. You are right, the current explanatory text might be somewhat confusing, we will rephrase it. |
Beta Was this translation helpful? Give feedback.
-
@Digital-Pig-LLC https://docs.dotkernel.org/api-documentation/v5/core-features/authorization/#usage If it helps, for example: |
Beta Was this translation helpful? Give feedback.
-
I just found in: authorization.global.php, this:
/**
* Example:
'roles' => [
'A' => [],
'B' => ['A'],
'C' => ['B'],
],
* A has no parent role.
* B has A as a parent. That means A inherits the permissions of B.
* C has B as a parent. That means B inherits the permissions of C, and A inherits the permissions of C.
*/
In RBAC, the idea is that roles inherit permissions from their parent roles. So, if a role doesn't have a parent, it should define its permissions explicitly.
The text seems to imply that "admin" inherits permissions from "superuser," but if "superuser" has no permissions, "admin" won’t inherit anything meaningful from "superuser."
In a more logical setup:
If "superuser" has no parent, it must have explicit permissions to be meaningful.
Beta Was this translation helpful? Give feedback.
All reactions