public function checksUserAccess(array $entityConfig, string $actionName, $subject = null)
    {
        if ($this->adminMinimumRole && !$this->authorizationChecker->isGranted($this->adminMinimumRole)) {
            throw new AccessDeniedException(
                \sprintf('You must be granted %s role to access admin !', $this->adminMinimumRole)
            );
        }

        $requiredRole = $this->getRequiredRole($entityConfig, $actionName);

        if ($requiredRole && !$this->authorizationChecker->isGranted($requiredRole, $subject)) {
            throw new AccessDeniedException(
                \sprintf('You must be granted %s role to perform this entity action !', $requiredRole)
            );
        }
    }
public function checksUserAccess(array $entityConfig, string $actionName, $subject = null)
    {
        if ($this->adminMinimumRole && !$this->authorizationChecker->isGranted($this->adminMinimumRole)) {
            throw new AccessDeniedException(
                \sprintf('You must be granted %s role to access admin !', $this->adminMinimumRole)
            );
        }

        $requiredRole = $this->getRequiredRole($entityConfig, $actionName);

        if ($requiredRole && !$this->authorizationChecker->isGranted($requiredRole, $subject)) {
            throw new AccessDeniedException(
                \sprintf('You must be granted %s role to perform this entity action !', $requiredRole)
            );
        }
    }
public function checksUserAccess ( array $ entityConfig , string $ actionName , $ subject = null ) { if ( $ this -> adminMinimumRole && ! $ this -> authorizationChecker -> isGranted ( $ this -> adminMinimumRole ) ) { throw new AccessDeniedException ( \ sprintf ( 'You must be granted %s role to access admin !' , $ this -> adminMinimumRole ) ) ; } $ requiredRole = $ this -> getRequiredRole ( $ entityConfig , $ actionName ) ; if ( $ requiredRole && ! $ this -> authorizationChecker -> isGranted ( $ requiredRole , $ subject ) ) { throw new AccessDeniedException ( \ sprintf ( 'You must be granted %s role to perform this entity action !' , $ requiredRole ) ) ; } }
Throws an error if user has no access to the entity action.

@param array  $entityConfig
@param string $actionName
@param mixed  $subject
Throws an error if user has no access to the entity action .