SecurityRole

enum \TYPO3\CMS\Core\Security\Authorization\SecurityRole: string

The roles a PrincipalUser holds, as the security component expects them: strings starting with "ROLE_", decided by its RoleVoter, e.g.

isGranted(SecurityRole::ADMIN->value). The roles of a group are no case, as they carry the uid of the group, see PrincipalUser.

There is no role for anonymous requests: they have no principal, and the attributes of the AuthenticatedVoter of the security component decide on them, e.g. isGranted(AuthenticatedVoter::IS_AUTHENTICATED).

Table of Contents

Cases

ADMIN  = 'ROLE_ADMIN'
Administrators, system maintainers and the system
BACKEND_USER  = 'ROLE_BACKEND_USER'
Every principal of the backend realm
FRONTEND_USER  = 'ROLE_FRONTEND_USER'
Every principal of a frontend realm. This is the "show at any login" group (-2) of the fe_group field; "hide at login" (-1) is a request without principal, see AuthenticatedVoter::IS_AUTHENTICATED.
MAINTAINER  = 'ROLE_MAINTAINER'
System maintainers and the system
SYSTEM  = 'ROLE_SYSTEM'
The system itself, e.g. CLI and internal processes
USER  = 'ROLE_USER'
The base role of the security component: every authenticated principal of every realm, backend and frontend users alike. Use BACKEND_USER or FRONTEND_USER to tell them apart.

Methods

fromPrincipalRole()  : array<int, self>
The roles granted by a principal role. They are cumulative: an admin also holds the role of a user, a maintainer the one of an admin, and the system every role.

Cases

USER

The base role of the security component: every authenticated principal of every realm, backend and frontend users alike. Use BACKEND_USER or FRONTEND_USER to tell them apart.

ADMIN

Administrators, system maintainers and the system

MAINTAINER

System maintainers and the system

SYSTEM

The system itself, e.g. CLI and internal processes

BACKEND_USER

Every principal of the backend realm

FRONTEND_USER

Every principal of a frontend realm. This is the "show at any login" group (-2) of the fe_group field; "hide at login" (-1) is a request without principal, see AuthenticatedVoter::IS_AUTHENTICATED.

Methods

fromPrincipalRole()

The roles granted by a principal role. They are cumulative: an admin also holds the role of a user, a maintainer the one of an admin, and the system every role.

public static fromPrincipalRole(PrincipalRole $role) : array<int, self>

Parameters

$role : PrincipalRole

Return values

array<int, self>
On this page