Pimcore\WorkflowManagement\Workflow\Manager::userCanPerformAction PHP Метод

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

Returns whether or not a user can perform an action if a status is given then it will be taken into consideration
public userCanPerformAction ( $actionName, null $statusName = null ) : boolean
$actionName
$statusName null
Результат boolean
    public function userCanPerformAction($actionName, $statusName = null)
    {
        if (!$this->user) {
            throw new \Exception('No user is defined in this Workflow Manager!');
        }
        if ($this->user->isAdmin()) {
            return true;
        }
        $requiredUserIds = $this->workflow->getValidUsersForAction($actionName, $statusName);
        if ($requiredUserIds === null) {
            return true;
        }
        foreach ($requiredUserIds as $id) {
            if (in_array($id, $this->userIds)) {
                return true;
            }
        }
        return false;
    }