PHP Класс Webiny\Component\Security\User\AbstractUser

You can optionally extend this class if you want to inherit the common getter functions.
Наследование: implements Webiny\Component\Security\User\UserInterface, use trait Webiny\Component\StdLib\StdLibTrait
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
authenticate ( Login $login, Firewall $firewall ) : boolean This method verifies the credentials of current user with the credentials provided from the Login object.
getAuthProviderName ( ) : string Returns the name of auth provider.
getPassword ( ) : string
getRoles ( ) : array Get a list of assigned roles
getUserProviderName ( ) : string Returns the name of user provider.
getUsername ( ) : string
hasRole ( string $role ) : boolean Check if current user has the defined role.
isAuthenticated ( ) : boolean Check if user is already authenticated.
isTokenValid ( TokenData $tokenData ) : boolean This method compares the $tokenData against the current user and returns true if users are identical, otherwise false is returned.
populate ( string $username, string $password, array $roles, boolean $isAuthenticated = false ) Populate the user object.
setAuthProviderName ( string $name ) Set the name of the auth provider.
setIsAuthenticated ( boolean $bool ) Sets the auth flag.
setRoles ( array $roles ) Sets the user roles.
setUserProviderName ( string $name ) Set the name of the user provider.

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

authenticate() абстрактный публичный Метод

This method verifies the credentials of current user with the credentials provided from the Login object.
abstract public authenticate ( Login $login, Firewall $firewall ) : boolean
$login Webiny\Component\Security\Authentication\Providers\Login
$firewall Webiny\Component\Security\Authentication\Firewall
Результат boolean Return true if credentials are valid, otherwise return false.

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

Returns the name of auth provider.
public getAuthProviderName ( ) : string
Результат string

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

public getPassword ( ) : string
Результат string Hashed password.

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

Get a list of assigned roles
public getRoles ( ) : array
Результат array List of assigned roles.

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

Returns the name of user provider.
public getUserProviderName ( ) : string
Результат string

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

public getUsername ( ) : string
Результат string Username.

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

Check if current user has the defined role.
public hasRole ( string $role ) : boolean
$role string Role name
Результат boolean True if user has the role, otherwise false.

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

Check if user is already authenticated.
public isAuthenticated ( ) : boolean
Результат boolean True if user is authenticated, otherwise false.

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

This method compares the $tokenData against the current user and returns true if users are identical, otherwise false is returned.
public isTokenValid ( TokenData $tokenData ) : boolean
$tokenData Webiny\Component\Security\Token\TokenData
Результат boolean

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

Populate the user object.
public populate ( string $username, string $password, array $roles, boolean $isAuthenticated = false )
$username string Username.
$password string Hashed password.
$roles array Array of the assigned roles.
$isAuthenticated boolean Boolean flag that tells us if user is already authenticated or not.

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

Set the name of the auth provider.
public setAuthProviderName ( string $name )
$name string

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

Sets the auth flag.
public setIsAuthenticated ( boolean $bool )
$bool boolean

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

Sets the user roles.
public setRoles ( array $roles )
$roles array An array of Role instances.

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

Set the name of the user provider.
public setUserProviderName ( string $name )
$name string