Security/Authorization/AuthorizationHelper.php
public function getReachableCircles(User $user, Role $role, Center $center)
    {
        $scopes = array();
        
        foreach ($user->getGroupCenters() as $groupCenter){
            if ($center->getId() === $groupCenter->getCenter()->getId()) {
                //iterate on permissionGroup
                $permissionGroup = $groupCenter->getPermissionsGroup();
                //iterate on roleScopes
                foreach($permissionGroup->getRoleScopes() as $roleScope) {
                    //check that the role is in the reachable roles
                    if ($this->isRoleReached($role, 
                          new Role($roleScope->getRole()))) {

                        $scopes[] = $roleScope->getScope();
                    }
                }
            }
        }
        
        return $scopes;
    }
public function getReachableCircles(User $user, Role $role, Center $center)
    {
        $scopes = array();
        
        foreach ($user->getGroupCenters() as $groupCenter){
            if ($center->getId() === $groupCenter->getCenter()->getId()) {
                //iterate on permissionGroup
                $permissionGroup = $groupCenter->getPermissionsGroup();
                //iterate on roleScopes
                foreach($permissionGroup->getRoleScopes() as $roleScope) {
                    //check that the role is in the reachable roles
                    if ($this->isRoleReached($role, 
                          new Role($roleScope->getRole()))) {

                        $scopes[] = $roleScope->getScope();
                    }
                }
            }
        }
        
        return $scopes;
    }
public function getReachableCircles ( User $ user , Role $ role , Center $ center ) { $ scopes = array ( ) ; foreach ( $ user -> getGroupCenters ( ) as $ groupCenter ) { if ( $ center -> getId ( ) === $ groupCenter -> getCenter ( ) -> getId ( ) ) { //iterate on permissionGroup $ permissionGroup = $ groupCenter -> getPermissionsGroup ( ) ; //iterate on roleScopes foreach ( $ permissionGroup -> getRoleScopes ( ) as $ roleScope ) { //check that the role is in the reachable roles if ( $ this -> isRoleReached ( $ role , new Role ( $ roleScope -> getRole ( ) ) ) ) { $ scopes [ ] = $ roleScope -> getScope ( ) ; } } } } return $ scopes ; }
Return all reachable circle for a given user, center and role

@param User $user
@param Role $role
@param Center $center
@return Scope[]
Return all reachable circle for a given user center and role