PHP Класс Prado\Security\TAuthorizationRule
TAuthorizationRule represents a single authorization rule.
A rule is specified by an action (required), a list of users (optional),
a list of roles (optional), a verb (optional), and a list of IP rules (optional).
Action can be either 'allow' or 'deny'.
Guest (anonymous, unauthenticated) users are represented by question mark '?'.
All users (including guest users) are represented by asterisk '*'.
Authenticated users are represented by '@'.
Users/roles are case-insensitive.
Different users/roles are separated by comma ','.
Verb can be either 'get' or 'post'. If it is absent, it means both.
IP rules are separated by comma ',' and can contain wild card in the rules (e.g. '192.132.23.33, 192.122.*.*')
Показать файл
Открыть проект
Открытые методы
Приватные методы
Описание методов
__construct()
публичный метод
public __construct ( $action, $users, $roles, $verb = '', $ipRules = '' ) |
getAction()
публичный метод
getAuthenticatedApplied()
публичный метод
getEveryoneApplied()
публичный метод
getGuestApplied()
публичный метод
getIPRules()
публичный метод
getRoles()
публичный метод
getUsers()
публичный метод
getVerb()
публичный метод
isUserAllowed()
публичный метод
public isUserAllowed ( Prado\Security\IUser $user, $verb, $ip ) : integer |
$user |
Prado\Security\IUser |
|
Результат |
integer |
1 if the user is allowed, -1 if the user is denied, 0 if the rule does not apply to the user |