PHP Class Neos\Flow\Security\Account

显示文件 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$accountIdentifier string
$authenticationProviderName string
$creationDate DateTime
$credentialsSource string
$expirationDate DateTime
$failedAuthenticationCount integer
$lastSuccessfulAuthenticationDate DateTime
$now Neos\Flow\Utility\Now
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$policyService Neos\Flow\Security\Policy\PolicyService
$roleIdentifiers of strings
$roles array

Public Methods

Method Description
__construct ( ) Upon creation the creationDate property is initialized.
addRole ( Role $role ) : void Adds a role to this account
authenticationAttempted ( integer $authenticationStatus ) : void Sets the authentication status. Usually called by the responsible \Neos\Flow\Security\Authentication\AuthenticationManagerInterface
getAccountIdentifier ( ) : string Returns the account identifier
getAuthenticationProviderName ( ) : string Returns the authentication provider name this account corresponds to
getCreationDate ( ) : DateTime Returns the date on which this account has been created.
getCredentialsSource ( ) : mixed Returns the credentials source
getExpirationDate ( ) : DateTime Returns the date on which this account has expired or will expire. If no expiration date has been set, NULL is returned.
getFailedAuthenticationCount ( ) : integer
getLastSuccessfulAuthenticationDate ( ) : DateTime
getRoles ( ) : array Returns the roles this account has assigned
hasRole ( Role $role ) : boolean Return if the account has a certain role
isActive ( ) : boolean Returns TRUE if it is currently allowed to use this account for authentication.
removeRole ( Role $role ) : void Removes a role from this account
setAccountIdentifier ( string $accountIdentifier ) : void Set the account identifier
setAuthenticationProviderName ( string $authenticationProviderName ) : void Set the authentication provider name this account corresponds to
setCredentialsSource ( mixed $credentialsSource ) : void Sets the credentials source
setExpirationDate ( DateTime $expirationDate = null ) : void Sets the date on which this account will become inactive
setRoles ( array $roles ) : void Sets the roles for this account

Protected Methods

Method Description
initializeRoles ( ) : void Initializes the roles field by fetching the role objects referenced by the roleIdentifiers

Method Details

__construct() public method

Upon creation the creationDate property is initialized.
public __construct ( )

addRole() public method

Adds a role to this account
public addRole ( Role $role ) : void
$role Neos\Flow\Security\Policy\Role
return void

authenticationAttempted() public method

Sets the authentication status. Usually called by the responsible \Neos\Flow\Security\Authentication\AuthenticationManagerInterface
public authenticationAttempted ( integer $authenticationStatus ) : void
$authenticationStatus integer One of WRONG_CREDENTIALS, AUTHENTICATION_SUCCESSFUL
return void

getAccountIdentifier() public method

Returns the account identifier
public getAccountIdentifier ( ) : string
return string The account identifier

getAuthenticationProviderName() public method

Returns the authentication provider name this account corresponds to
public getAuthenticationProviderName ( ) : string
return string The authentication provider name

getCreationDate() public method

Returns the date on which this account has been created.
public getCreationDate ( ) : DateTime
return DateTime

getCredentialsSource() public method

Returns the credentials source
public getCredentialsSource ( ) : mixed
return mixed The credentials source

getExpirationDate() public method

Returns the date on which this account has expired or will expire. If no expiration date has been set, NULL is returned.
public getExpirationDate ( ) : DateTime
return DateTime

getFailedAuthenticationCount() public method

getLastSuccessfulAuthenticationDate() public method

public getLastSuccessfulAuthenticationDate ( ) : DateTime
return DateTime

getRoles() public method

Returns the roles this account has assigned
public getRoles ( ) : array
return array

hasRole() public method

Return if the account has a certain role
public hasRole ( Role $role ) : boolean
$role Neos\Flow\Security\Policy\Role
return boolean

initializeRoles() protected method

Initializes the roles field by fetching the role objects referenced by the roleIdentifiers
protected initializeRoles ( ) : void
return void

isActive() public method

Returns FALSE if the account has expired.
public isActive ( ) : boolean
return boolean

removeRole() public method

Removes a role from this account
public removeRole ( Role $role ) : void
$role Neos\Flow\Security\Policy\Role
return void

setAccountIdentifier() public method

Set the account identifier
public setAccountIdentifier ( string $accountIdentifier ) : void
$accountIdentifier string The account identifier
return void

setAuthenticationProviderName() public method

Set the authentication provider name this account corresponds to
public setAuthenticationProviderName ( string $authenticationProviderName ) : void
$authenticationProviderName string The authentication provider name
return void

setCredentialsSource() public method

Sets the credentials source
public setCredentialsSource ( mixed $credentialsSource ) : void
$credentialsSource mixed The credentials source
return void

setExpirationDate() public method

Sets the date on which this account will become inactive
public setExpirationDate ( DateTime $expirationDate = null ) : void
$expirationDate DateTime
return void

setRoles() public method

Sets the roles for this account
public setRoles ( array $roles ) : void
$roles array
return void

Property Details

$accountIdentifier protected_oe property

protected string $accountIdentifier
return string

$authenticationProviderName protected_oe property

protected string $authenticationProviderName
return string

$creationDate protected_oe property

protected DateTime $creationDate
return DateTime

$credentialsSource protected_oe property

protected string $credentialsSource
return string

$expirationDate protected_oe property

protected DateTime $expirationDate
return DateTime

$failedAuthenticationCount protected_oe property

protected int $failedAuthenticationCount
return integer

$lastSuccessfulAuthenticationDate protected_oe property

protected DateTime $lastSuccessfulAuthenticationDate
return DateTime

$now protected_oe property

protected Now,Neos\Flow\Utility $now
return Neos\Flow\Utility\Now

$objectManager protected_oe property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
return Neos\Flow\ObjectManagement\ObjectManagerInterface

$policyService protected_oe property

protected PolicyService,Neos\Flow\Security\Policy $policyService
return Neos\Flow\Security\Policy\PolicyService

$roleIdentifiers protected_oe property

of strings
protected $roleIdentifiers

$roles protected_oe property

protected array $roles
return array