How to manage this allan roles package complexity?


I was studying a more complex case needed to apply allan roles package (maybe with groups).

I got a case where I need to have permissions (add_person, remove_person) where I would like to group that some way (manage_person has these 2 permissions) and also group these “groups of permission” in a module (module User Control has manage_person and manage_forum groups, and each of it has it’s own permissions).

How can I manage this hierarchy:

Module 1
Group 1
N permissions
N permissions

Module 2
Group 3

With roles package? What if I need a “hasModule”, “hasGroup” or “hasPermission” checks?