PHP Trait Airship\Engine\Bolt\Security

Common security features. Mostly access controls.
Afficher le fichier Open project: paragonie/airship

Méthodes publiques

Свойство Type Description
$airship_auth Authentication
$airship_perms Permissions

Méthodes publiques

Méthode Description
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.)

Méthodes protégées

Méthode Description
doAutoLogin ( string $token, string $uid_idx, string $token_idx ) : boolean Let's do an automatic login

Method Details

can() public méthode

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)
Résultat boolean

completeLogOut() public méthode

Completely wipe all authentication mechanisms (Session, Cookie)
public completeLogOut ( ) : boolean
Résultat boolean

doAutoLogin() protected méthode

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
Résultat boolean

getActiveUserId() public méthode

Get the current user ID. Throws a UserNotLoggedIn exception if you aren't logged in.
public getActiveUserId ( ) : integer
Résultat integer

isLoggedIn() public méthode

Are we logged in to a user account?
public isLoggedIn ( ) : boolean
Résultat boolean

isSuperUser() public méthode

Are we currently logged in as an admin?
public isSuperUser ( integer $userId ) : boolean
$userId integer (defaults to current user)
Résultat boolean

tightenSecurityBolt() public méthode

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

verifySessionCanary() public méthode

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
Résultat boolean

Property Details

$airship_auth public_oe property

public Authentication $airship_auth
Résultat Authentication

$airship_perms public_oe property

public Permissions $airship_perms
Résultat Permissions