PHP Трейт Airship\Engine\Bolt\Security

Common security features. Mostly access controls.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$airship_auth Authentication
$airship_perms Permissions

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

Метод Описание
can ( string $action, string $context = '', string $cabin = '', integer $userID ) : boolean Perform a permissions check
completeLogOut ( ) : boolean Completely wipe all authentication mechanisms (Session, Cookie)
getActiveUserId ( ) : integer Get the current user ID. Throws a UserNotLoggedIn exception if you aren't logged in.
isLoggedIn ( ) : boolean Are we logged in to a user account?
isSuperUser ( integer $userId ) : boolean Are we currently logged in as an admin?
tightenSecurityBolt ( ) After loading the Security bolt in place, configure it.
verifySessionCanary ( integer $userID, boolean $logOut = true ) : boolean If another session triggered a password reset, we should be logged out as per the Bridge configuration. (This /is/ an optional feature.)

Защищенные методы

Метод Описание
doAutoLogin ( string $token, string $uid_idx, string $token_idx ) : boolean Let's do an automatic login

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

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

Perform a permissions check
public can ( string $action, string $context = '', string $cabin = '', integer $userID ) : boolean
$action string action label (e.g. 'read')
$context string context regex (in perm_contexts)
$cabin string (defaults to current cabin)
$userID integer (defaults to current user)
Результат boolean

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

Completely wipe all authentication mechanisms (Session, Cookie)
public completeLogOut ( ) : boolean
Результат boolean

doAutoLogin() защищенный Метод

Let's do an automatic login
protected doAutoLogin ( string $token, string $uid_idx, string $token_idx ) : boolean
$token string
$uid_idx string
$token_idx string
Результат boolean

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

Get the current user ID. Throws a UserNotLoggedIn exception if you aren't logged in.
public getActiveUserId ( ) : integer
Результат integer

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

Are we logged in to a user account?
public isLoggedIn ( ) : boolean
Результат boolean

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

Are we currently logged in as an admin?
public isSuperUser ( integer $userId ) : boolean
$userId integer (defaults to current user)
Результат boolean

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

After loading the Security bolt in place, configure it.
public tightenSecurityBolt ( )

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

If another session triggered a password reset, we should be logged out as per the Bridge configuration. (This /is/ an optional feature.)
public verifySessionCanary ( integer $userID, boolean $logOut = true ) : boolean
$userID integer
$logOut boolean
Результат boolean

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

$airship_auth публичное свойство

public Authentication $airship_auth
Результат Authentication

$airship_perms публичное свойство

public Permissions $airship_perms
Результат Permissions