Permission/PermissionManager.php
private function doIsGrantedPermission($id, array $sids, $operation, $subject = null, $field = null)
    {
        $event = new CheckPermissionEvent($sids, $this->cache[$id], $operation, $subject, $field);
        $this->dispatcher->dispatch(PermissionEvents::CHECK_PERMISSION, $event);

        if (\is_bool($event->isGranted())) {
            return $event->isGranted();
        }

        $classAction = PermissionUtils::getMapAction(null !== $subject ? $subject->getType() : null);
        $fieldAction = PermissionUtils::getMapAction($field);

        return isset($this->cache[$id][$classAction][$fieldAction][$operation])
            || $this->isSharingGranted($operation, $subject, $field);
    }
private function doIsGrantedPermission($id, array $sids, $operation, $subject = null, $field = null)
    {
        $event = new CheckPermissionEvent($sids, $this->cache[$id], $operation, $subject, $field);
        $this->dispatcher->dispatch(PermissionEvents::CHECK_PERMISSION, $event);

        if (\is_bool($event->isGranted())) {
            return $event->isGranted();
        }

        $classAction = PermissionUtils::getMapAction(null !== $subject ? $subject->getType() : null);
        $fieldAction = PermissionUtils::getMapAction($field);

        return isset($this->cache[$id][$classAction][$fieldAction][$operation])
            || $this->isSharingGranted($operation, $subject, $field);
    }
private function doIsGrantedPermission ( $ id , array $ sids , $ operation , $ subject = null , $ field = null ) { $ event = new CheckPermissionEvent ( $ sids , $ this -> cache [ $ id ] , $ operation , $ subject , $ field ) ; $ this -> dispatcher -> dispatch ( PermissionEvents :: CHECK_PERMISSION , $ event ) ; if ( \ is_bool ( $ event -> isGranted ( ) ) ) { return $ event -> isGranted ( ) ; } $ classAction = PermissionUtils :: getMapAction ( null !== $ subject ? $ subject -> getType ( ) : null ) ; $ fieldAction = PermissionUtils :: getMapAction ( $ field ) ; return isset ( $ this -> cache [ $ id ] [ $ classAction ] [ $ fieldAction ] [ $ operation ] ) || $ this -> isSharingGranted ( $ operation , $ subject , $ field ) ; }
Action to determine whether access is granted for a specific operation.

@param string                        $id        The cache id
@param SecurityIdentityInterface[]   $sids      The security identities
@param string                        $operation The operation
@param null|SubjectIdentityInterface $subject   The subject
@param null|string                   $field     The field of subject

@return bool
Action to determine whether access is granted for a specific operation .