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
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
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