BookStack\Services\PermissionService::checkIfRestrictionsSet PHP Метод

checkIfRestrictionsSet() публичный Метод

Check if an entity has restrictions set on itself or its parent tree.
public checkIfRestrictionsSet ( Entity $entity, $action ) : boolean | mixed
$entity BookStack\Entity
$action
Результат boolean | mixed
    public function checkIfRestrictionsSet(Entity $entity, $action)
    {
        $this->currentAction = $action;
        if ($entity->isA('page')) {
            return $entity->restricted || $entity->chapter && $entity->chapter->restricted || $entity->book->restricted;
        } elseif ($entity->isA('chapter')) {
            return $entity->restricted || $entity->book->restricted;
        } elseif ($entity->isA('book')) {
            return $entity->restricted;
        }
    }