Свойство | Тип | Описание | |
---|---|---|---|
$authenticatedRole | default role for authenticated user without own identity | ||
$guestRole | default role for unauthenticated user | ||
$onLoggedIn | function (User $sender); Occurs when the user is successfully logged in | ||
$onLoggedOut | function (User $sender); Occurs when the user is logged out |
Метод | Описание | |
---|---|---|
__construct ( Nette\Security\IUserStorage $storage, Nette\Security\IAuthenticator $authenticator = NULL, Nette\Security\IAuthorizator $authorizator = NULL ) | ||
getAuthenticator ( $need = TRUE ) : Nette\Security\IAuthenticator | Returns authentication handler. | |
getAuthorizator ( $need = TRUE ) : Nette\Security\IAuthorizator | Returns current authorization handler. | |
getId ( ) : mixed | Returns current user ID, if any. | |
getIdentity ( ) : Nette\Security\IIdentity | null | Returns current user identity, if any. | |
getLogoutReason ( ) : integer | Why was user logged out? | |
getRoles ( ) : array | Returns a list of effective roles that a user has been granted. | |
getStorage ( ) : Nette\Security\IUserStorage | ||
isAllowed ( $resource = IAuthorizator::ALL, $privilege = IAuthorizator::ALL ) : boolean | Has a user effective access to the Resource? If $resource is NULL, then the query applies to all resources. | |
isInRole ( $role ) : boolean | Is a user in the specified effective role? | |
isLoggedIn ( ) : boolean | Is this user authenticated? | |
login ( $id = NULL, $password = NULL ) : void | Conducts the authentication process. Parameters are optional. | |
logout ( $clearIdentity = FALSE ) : void | Logs out the user from the current session. | |
setAuthenticator ( Nette\Security\IAuthenticator $handler ) : self | Sets authentication handler. | |
setAuthorizator ( Nette\Security\IAuthorizator $handler ) : self | Sets authorization handler. | |
setExpiration ( $time, $whenBrowserIsClosed = TRUE, $clearIdentity = FALSE ) : self | Enables log out after inactivity. |
public __construct ( Nette\Security\IUserStorage $storage, Nette\Security\IAuthenticator $authenticator = NULL, Nette\Security\IAuthorizator $authorizator = NULL ) | ||
$storage | Nette\Security\IUserStorage | |
$authenticator | Nette\Security\IAuthenticator | |
$authorizator | Nette\Security\IAuthorizator |
public getAuthenticator ( $need = TRUE ) : Nette\Security\IAuthenticator | ||
Результат | Nette\Security\IAuthenticator |
public getAuthorizator ( $need = TRUE ) : Nette\Security\IAuthorizator | ||
Результат | Nette\Security\IAuthorizator |
public getIdentity ( ) : Nette\Security\IIdentity | null | ||
Результат | Nette\Security\IIdentity | null |
public getLogoutReason ( ) : integer | ||
Результат | integer |
public getStorage ( ) : Nette\Security\IUserStorage | ||
Результат | Nette\Security\IUserStorage |
public isLoggedIn ( ) : boolean | ||
Результат | boolean |
public setAuthenticator ( Nette\Security\IAuthenticator $handler ) : self | ||
$handler | Nette\Security\IAuthenticator | |
Результат | self |
public setAuthorizator ( Nette\Security\IAuthorizator $handler ) : self | ||
$handler | Nette\Security\IAuthorizator | |
Результат | self |
public setExpiration ( $time, $whenBrowserIsClosed = TRUE, $clearIdentity = FALSE ) : self | ||
Результат | self |
public $authenticatedRole |
public $onLoggedIn |