main/core/Manager/Resource/ResourceRestrictionsManager.php
public function hasRights(ResourceNode $resourceNode, array $userRoles): bool
    {
        $isAdmin = false;

        if ($workspace = $resourceNode->getWorkspace()) {
            $isAdmin = $this->security->isGranted('administrate', $workspace);
        }

        return 0 !== $this->rightsManager->getMaximumRights($userRoles, $resourceNode) || $isAdmin;
    }
public function hasRights(ResourceNode $resourceNode, array $userRoles): bool
    {
        $isAdmin = false;

        if ($workspace = $resourceNode->getWorkspace()) {
            $isAdmin = $this->security->isGranted('administrate', $workspace);
        }

        return 0 !== $this->rightsManager->getMaximumRights($userRoles, $resourceNode) || $isAdmin;
    }
public function hasRights ( ResourceNode $ resourceNode , array $ userRoles ) : bool { $ isAdmin = false ; if ( $ workspace = $ resourceNode -> getWorkspace ( ) ) { $ isAdmin = $ this -> security -> isGranted ( 'administrate' , $ workspace ) ; } return 0 !== $ this -> rightsManager -> getMaximumRights ( $ userRoles , $ resourceNode ) || $ isAdmin ; }
Checks if a user has at least the right to access to one of the resource action.

@param ResourceNode $resourceNode
@param Role[]       $userRoles

@return bool
Checks if a user has at least the right to access to one of the resource action .