node_acl icon indicating copy to clipboard operation
node_acl copied to clipboard

addRoleParents wrong terminology

Open yonjah opened this issue 10 years ago • 2 comments

I might be missing something with the terminology, but shouldn't we look at Role Hierarchy as a tree where all Parent nodes has all the permissions of their child nodes ?

So node has single Parent, Multiple children, and can access child resources but can't access parent resources.

It seems like node_acl is looking at it the opposite way.

  1. Role can have multiple Parents.
  2. Role has access to its Parents resources and they can't access its own resources Which means addRoleParents is actually addRoleChildrens

yonjah avatar Apr 02 '15 03:04 yonjah

Exactly!

This is the situation I stumbled upon. I think the terminology is designed after Liskov Substitution Principle, which states that child classes inherit all the properties of parent classes, and can be used instead of the parent class in any case. Furthermore, specialization occurs in child classes and they are beyond the scope of the parent classes.

So it's not a tree in that the parents have all the access to the children, but a strict type hierarchy called behavioral subtyping.

dashersw avatar Jan 25 '16 12:01 dashersw

Ok so to clarify:

acl.addRoleParents('usermanager', 'user'); //usermanager inherits all permissions of user
acl.addRoleParents('admin', 'usermanager'); //admin inherits all permissions of usermanager AND user

miparnisari avatar Dec 13 '16 05:12 miparnisari