PrincipalUser
final readonly class \
- Implements
- UserInterface
Presents a Principal as user of the Symfony security component, so that voters receive the immutable Principal instead of a user authentication object.
The roles are the cumulative SecurityRole cases of the principal role,
plus SecurityRole::BACKEND_USER or SecurityRole::FRONTEND_USER, as
frontend principals carry the role "user" as well, and one role per
group, ROLE_BACKEND_GROUP_
Table of Contents
Interfaces
- UserInterface
Properties
Methods
- __construct() : mixed
- getRoles() : array<int, string>
- getUserIdentifier() : string
- Unique across realms, as a backend and a frontend user may share a username or a uid.
- hasRole() : bool
Properties
$principal
public
Principal
$principal
Methods
__construct()
public
__construct(Principal $principal) : mixed
Parameters
- $principal : Principal
getRoles()
public
getRoles() : array<int, string>
Return values
array<int, string>getUserIdentifier()
Unique across realms, as a backend and a frontend user may share a username or a uid.
public
getUserIdentifier() : string
Return values
stringhasRole()
public
hasRole(SecurityRole $role) : bool
Parameters
- $role : SecurityRole