LegacyUserPrincipalFactory
final class \
Builds a Principal snapshot from a legacy user authentication object, for the authenticators as well as for authorization decisions on behalf of any backend user: isGrantedForUser(new PrincipalUser($principal), ...).
Only needed during the migration period while authentication is still performed by the legacy user objects.
A backend user object is registered for its principal in the LegacyBackendUserRegistry, so that decisions are taken on the group data of that object, as the access checks of BackendUserAuthentication do. The role is BackendUserAuthentication::getRole() of the object itself.
The principal of a user object is built once, and anew only when the user, its role, groups, switch user mode or group data changed.
Internal
not part of TYPO3 Core API yet, only exists for the migration period and will vanish together with the legacy user objects
Table of Contents
Methods
- __construct() : mixed
- fromUser() : Principal|null
- Returns null for an anonymous user, and for a switch user session whose original user cannot be resolved: a principal of the switched user without the impersonating user is never established.
Methods
__construct()
public
__construct(LocalIdentityProvider $identityProvider, LegacyBackendUserRegistry $legacyUserRegistry) : mixed
Parameters
- $identityProvider : LocalIdentityProvider
- $legacyUserRegistry : LegacyBackendUserRegistry
fromUser()
Returns null for an anonymous user, and for a switch user session whose original user cannot be resolved: a principal of the switched user without the impersonating user is never established.
public
fromUser(AbstractUserAuthentication $user, Realm $realm) : Principal|null
Parameters
- $user : AbstractUserAuthentication
- $realm : Realm