class UserService (View source)

The user service provides general context information about the currently authenticated backend user.

The methods getters of this class are accessible via the "context.userInformation" variable in security policies and thus are implicitly considered to be part of the public API. This UserService should be replaced by \Neos\Neos\Domain\Service\UserService in the long run.

Properties

protected UserService $userDomainService
protected WorkspaceRepository $workspaceRepository
protected string $defaultLanguageIdentifier
protected Context $securityContext

Methods

getBackendUser()

Returns the current backend user

getPersonalWorkspace()

Returns the current user's personal workspace or null if no user is logged in

string
getPersonalWorkspaceName()

Returns the name of the currently logged in user's personal workspace (even if that might not exist at that time).

mixed
getUserPreference(string $preference)

Returns the stored preferences of a user

string
getInterfaceLanguage()

Returns the interface language the user selected. Will fall back to the default language defined in settings

Details

User getBackendUser()

Returns the current backend user

Return Value

User

Workspace getPersonalWorkspace()

Returns the current user's personal workspace or null if no user is logged in

Return Value

Workspace

string getPersonalWorkspaceName()

Returns the name of the currently logged in user's personal workspace (even if that might not exist at that time).

If no user is logged in this method returns null.

Return Value

string

mixed getUserPreference(string $preference)

Returns the stored preferences of a user

Parameters

string $preference

Return Value

mixed

string getInterfaceLanguage()

Returns the interface language the user selected. Will fall back to the default language defined in settings

Return Value

string