public function getConfigurableRights(ResourceNode $node)
    {
        $existing = $this->rightsRepo->findConfigurableRights($node);
        $roles = $node->getWorkspace()->getRoles();
        $missings = [];

        foreach ($roles as $role) {
            $found = false;
            foreach ($existing as $right) {
                if ($right->getRole()->getId() === $role->getId()) {
                    $found = true;
                }
            }

            if (!$found) {
                $missings[] = $role;
            }
        }

        if (0 === count($missings)) {
            return $existing;
        }

        // might be slow on large data trees
        foreach ($missings as $missing) {
            $this->create([], $missing, $node, true, []);
        }

        return $this->rightsRepo->findConfigurableRights($node);
    }
public function getConfigurableRights(ResourceNode $node)
    {
        $existing = $this->rightsRepo->findConfigurableRights($node);
        $roles = $node->getWorkspace()->getRoles();
        $missings = [];

        foreach ($roles as $role) {
            $found = false;
            foreach ($existing as $right) {
                if ($right->getRole()->getId() === $role->getId()) {
                    $found = true;
                }
            }

            if (!$found) {
                $missings[] = $role;
            }
        }

        if (0 === count($missings)) {
            return $existing;
        }

        // might be slow on large data trees
        foreach ($missings as $missing) {
            $this->create([], $missing, $node, true, []);
        }

        return $this->rightsRepo->findConfigurableRights($node);
    }
public function getConfigurableRights ( ResourceNode $ node ) { $ existing = $ this -> rightsRepo -> findConfigurableRights ( $ node ) ; $ roles = $ node -> getWorkspace ( ) -> getRoles ( ) ; $ missings = [ ] ; foreach ( $ roles as $ role ) { $ found = false ; foreach ( $ existing as $ right ) { if ( $ right -> getRole ( ) -> getId ( ) === $ role -> getId ( ) ) { $ found = true ; } } if ( ! $ found ) { $ missings [ ] = $ role ; } } if ( 0 === count ( $ missings ) ) { return $ existing ; } // might be slow on large data trees foreach ( $ missings as $ missing ) { $ this -> create ( [ ] , $ missing , $ node , true , [ ] ) ; } return $ this -> rightsRepo -> findConfigurableRights ( $ node ) ; }
Returns every ResourceRights of a resource on 1 level if the role linked is not 'ROLE_ADMIN'.

@param ResourceNode $node

@return ResourceRights[]

@deprecated no longer used in new manager
Returns every ResourceRights of a resource on 1 level if the role linked is not ROLE_ADMIN .