PHP Класс Webiny\Component\Security\Authorization\AccessControl

Наследование: use trait Webiny\Component\StdLib\StdLibTrait, use trait Webiny\Component\Http\HttpTrait, use trait Webiny\Component\ServiceManager\ServiceManagerTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$currentPath Webiny\Component\StdLib\StdObject\StringObject\StringObject Current path - based on current request.

Открытые методы

Метод Описание
__construct ( AbstractUser $user, ConfigObject $config ) Base constructor.
isUserAllowedAccess ( ) : boolean Checks if current user is allowed access.

Приватные методы

Метод Описание
getAccessDecision ( array $requestedRoles ) : boolean This method get the votes from all the voters and sends them to the ruling.
getCurrentPath ( ) : StringObject Returns current path (url) as StringObject instance.
getRequestedRoles ( ) : array Returns an array of roles required by the access rule.
getVoters ( ) : array Creates an array of registered Voters.
setDecisionStrategy ( ) Sets the decision strategy based on the application configuration.
testPath ( string $path ) : boolean Tests the given $path if it's within the current request path.
whatsTheRuling ( integer $votes, integer $maxVotes ) : boolean Method that decides if access is allowed or not based on the results of votes and the defined decision strategy.

Описание методов

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

Base constructor.
public __construct ( AbstractUser $user, ConfigObject $config )
$user Webiny\Component\Security\User\AbstractUser Instance of current user.
$config Webiny\Component\Config\ConfigObject Access control configuration.

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

Checks if current user is allowed access.
public isUserAllowedAccess ( ) : boolean
Результат boolean

Описание свойств

$currentPath защищенное свойство

Current path - based on current request.
protected StringObject,Webiny\Component\StdLib\StdObject\StringObject $currentPath
Результат Webiny\Component\StdLib\StdObject\StringObject\StringObject