PHP 클래스 EasyCorp\Bundle\EasySecurityBundle\Security\Security

파일 보기 프로젝트 열기: easycorp/easy-security-bundle

공개 메소드들

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

비공개 메소드들

메소드 설명
getUserRolesAsObjects ( Symfony\Component\Security\Core\User\UserInterface $user ) : Symfony\Component\Security\Core\Role\RoleInterface[] Returns an array with the roles of the given user turned into Role objects, which are needed by methods such as getReachableRoles().

메소드 상세

__construct() 공개 메소드

public __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 )
$tokenStorage Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface
$authorizationChecker Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface
$passwordEncoder Symfony\Component\Security\Core\Encoder\UserPasswordEncoder
$authenticationUtils Symfony\Component\Security\Http\Authentication\AuthenticationUtils
$session Symfony\Component\HttpFoundation\Session\Session
$roleHierarchy Symfony\Component\Security\Core\Role\RoleHierarchy

encodePassword() 공개 메소드

Returns the given plain password encoded/hashed using the encoder of the current application user or the optionally given user.
public encodePassword ( string $plainPassword, null $user = null ) : string
$plainPassword string
$user null
리턴 string

getImpersonatingUser() 공개 메소드

When impersonating a user, it returns the original user who started the impersonation.
public getImpersonatingUser ( ) : mixed
리턴 mixed

getLoginError() 공개 메소드

Returns the error of the last failed login attempt, if any.
public getLoginError ( ) : Symfony\Component\Security\Core\Exception\AuthenticationException | null
리턴 Symfony\Component\Security\Core\Exception\AuthenticationException | null

getLoginUsername() 공개 메소드

Returns the username of the last failed login attempt, if any.
public getLoginUsername ( ) : string | null
리턴 string | null

getUser() 공개 메소드

Returns the current application user.
public getUser ( ) : mixed
리턴 mixed

hasRole() 공개 메소드

Returns true if the current application user (or the optionally given user) has the given role. It takes into account the full role hierarchy.
public hasRole ( $role, null $user = null ) : boolean
$role
$user null
리턴 boolean

isAnonymous() 공개 메소드

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.
public isAnonymous ( null $user = null ) : boolean
$user null
리턴 boolean

isAuthenticated() 공개 메소드

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).
public isAuthenticated ( null $user = null ) : boolean
$user null
리턴 boolean

isFullyAuthenticated() 공개 메소드

Returns true if the current application user (or the optionally given user) is authenticated because they have introduced their credentials (username and password).
public isFullyAuthenticated ( null $user = null ) : boolean
$user null
리턴 boolean

isGranted() 공개 메소드

Checks if the attributes (usually security roles) are granted for the current application user and the optional given object.
public isGranted ( mixed $attributes, mixed $object = null ) : boolean
$attributes mixed
$object mixed
리턴 boolean

isPasswordValid() 공개 메소드

Returns true if the given plain password is valid for the current application user or the optionally given user.
public isPasswordValid ( string $plainPassword, null $user = null ) : boolean
$plainPassword string
$user null
리턴 boolean

isRemembered() 공개 메소드

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).
public isRemembered ( null $user = null ) : boolean
$user null
리턴 boolean

login() 공개 메소드

It logs in the given user in the 'main' application firewall (or the optionally given firewall name).
public login ( Symfony\Component\Security\Core\User\UserInterface $user, string $firewallName = 'main' ) : Symfony\Component\Security\Core\User\UserInterface
$user Symfony\Component\Security\Core\User\UserInterface
$firewallName string
리턴 Symfony\Component\Security\Core\User\UserInterface