Roles explanation needs to be better #334
Digital-Pig-LLC
started this conversation in
General
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. |
0 replies
|
@Digital-Pig-LLC https://docs.dotkernel.org/api-documentation/v5/core-features/authorization/#usage If it helps, for example: |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
All reactions