Метод |
Описание |
|
__construct ( Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface $tokenStorage, Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface $authorizationChecker, Symfony\Component\Security\Core\Encoder\UserPasswordEncoder $passwordEncoder, Symfony\Component\Security\Http\Authentication\AuthenticationUtils $authenticationUtils, Symfony\Component\HttpFoundation\Session\Session $session, Symfony\Component\Security\Core\Role\RoleHierarchy $roleHierarchy ) |
|
|
encodePassword ( string $plainPassword, null $user = null ) : string |
Returns the given plain password encoded/hashed using the encoder of the
current application user or the optionally given user. |
|
getImpersonatingUser ( ) : mixed |
When impersonating a user, it returns the original user who started
the impersonation. |
|
getLoginError ( ) : Symfony\Component\Security\Core\Exception\AuthenticationException | null |
Returns the error of the last failed login attempt, if any. |
|
getLoginUsername ( ) : string | null |
Returns the username of the last failed login attempt, if any. |
|
getUser ( ) : mixed |
Returns the current application user. |
|
hasRole ( $role, null $user = null ) : boolean |
Returns true if the current application user (or the optionally given user)
has the given role. It takes into account the full role hierarchy. |
|
isAnonymous ( null $user = null ) : boolean |
Returns true if the current application user (or the optionally given user)
is anonymous. This behaves differently than Symfony built-in methods and
it returns true only when the user is really anonymous. |
|
isAuthenticated ( null $user = null ) : boolean |
Returns true if the current application user (or the optionally given user)
is authenticated in any way (because they have introduced their credentials
(username and password) or they have been remembered). |
|
isFullyAuthenticated ( null $user = null ) : boolean |
Returns true if the current application user (or the optionally given user)
is authenticated because they have introduced their credentials (username
and password). |
|
isGranted ( mixed $attributes, mixed $object = null ) : boolean |
Checks if the attributes (usually security roles) are granted for the
current application user and the optional given object. |
|
isPasswordValid ( string $plainPassword, null $user = null ) : boolean |
Returns true if the given plain password is valid for the current
application user or the optionally given user. |
|
isRemembered ( null $user = null ) : boolean |
Returns true if the current application user (or the optionally given user)
is remembered. This behaves differently than Symfony built-in methods and
it returns true only when the user is really remembered and they haven't
introduced their credentials (username and password). |
|
login ( Symfony\Component\Security\Core\User\UserInterface $user, string $firewallName = 'main' ) : Symfony\Component\Security\Core\User\UserInterface |
It logs in the given user in the 'main' application firewall (or the
optionally given firewall name). |
|