For my own understanding, I'm writing a Hierarchical Discretionary Access System. It is not DAC, it is more akin to Discretionary RBAC, but those details do not matter for the question at hand.
Each user
has a certain Role
; each Role
has a certain set of permissions
.
Each Role
is organised in a hierarchical tree-like structure: the role
named root has all permissions; child roles of root have a subset of the permission of their parent role.
Schematic views of the above:
Let's say that a user
with the role
named manager decides to delegate the permission
named set_salary to a user
with the role
named programmer, who subsequently delegates this permission
to the user
with the role
named intern.
Somebody decides to fire said user
with the role named manager. As a result, the role
named manager is revoked from said user
. What is more, all permissions delegated by said user
also need to be revoked.
So my question is:
Is there a data structure which facilitates easy identification of:
- the chain of permissions delegated by a certain subject within a hierarchical tree structure;
- whether or not a certain permission has been delegated to a certain subject?