Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

multiple accessInherits at acl

hi. my acl is like :

$guestRoles = new Role('guest');

$userRoles = new Role('user');

$secretary = new Role('secretary');

$consultant = new Role('consultant');

$managerRoles = new Role('manager');

$adminRoles = new Role('admin');

i want to have the "secretary","consultant","manager" above the user role and admin role above this three role .

$acl->addRole($guestRoles);

$acl->addRole($userRoles, $guestRoles);

acl->addRole($managerRoles, $userRoles);

$acl->addRole($secretary, $userRoles);

$acl->addRole($consultant, $userRoles);

$acl->addRole($adminRoles, $consultant);

$acl->addRole($adminRoles, $secretary);

$acl->addRole($adminRoles, $managerRoles);

is this the correct way to implement ? i want adminRole to inherit 3 role that are the same level .



107.4k
Accepted
answer

AddRole is for adding role one time. So you can add admin role only once using addRole, if you want to inherit rules from secretary and manager then you need to use addInherit method instead of addRole.



150

@Wojciech Thanks . i didnt know about addInherit method .