PHP Class Neos\Neos\Service\UserService

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.
Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$defaultLanguageIdentifier string
$userDomainService Neos\Neos\Domain\Service\UserService
$workspaceRepository Neos\ContentRepository\Domain\Repository\WorkspaceRepository

Public Methods

Method Description
getBackendUser ( ) : User Returns the current backend user
getInterfaceLanguage ( ) : string Returns the interface language the user selected. Will fall back to the default language defined in settings
getPersonalWorkspace ( ) : Workspace Returns the current user's personal workspace or null if no user is logged in
getPersonalWorkspaceName ( ) : string Returns the name of the currently logged in user's personal workspace (even if that might not exist at that time).
getUserPreference ( string $preference ) : mixed Returns the stored preferences of a user
getUserWorkspace ( ) : Workspace Returns the current user's personal workspace or null if no user is logged in.
getUserWorkspaceName ( ) : string Returns the name of the currently logged in user's personal workspace (even if that might not exist at that time).

Method Details

getBackendUser() public method

Returns the current backend user
public getBackendUser ( ) : User
return Neos\Neos\Domain\Model\User

getInterfaceLanguage() public method

Returns the interface language the user selected. Will fall back to the default language defined in settings
public getInterfaceLanguage ( ) : string
return string

getPersonalWorkspace() public method

Returns the current user's personal workspace or null if no user is logged in
public getPersonalWorkspace ( ) : Workspace
return Neos\ContentRepository\Domain\Model\Workspace

getPersonalWorkspaceName() public method

If no user is logged in this method returns null.
public getPersonalWorkspaceName ( ) : string
return string

getUserPreference() public method

Returns the stored preferences of a user
public getUserPreference ( string $preference ) : mixed
$preference string
return mixed

getUserWorkspace() public method

Deprecated, use getPersonalWorkspace() instead.
Deprecation: 2.1
public getUserWorkspace ( ) : Workspace
return Neos\ContentRepository\Domain\Model\Workspace

getUserWorkspaceName() public method

If no user is logged in this method returns null. Deprecated, use getPersonalWorkspaceName() instead.
Deprecation: 2.1
public getUserWorkspaceName ( ) : string
return string

Property Details

$defaultLanguageIdentifier protected property

protected string $defaultLanguageIdentifier
return string

$userDomainService protected property

protected UserService,Neos\Neos\Domain\Service $userDomainService
return Neos\Neos\Domain\Service\UserService

$workspaceRepository protected property

protected WorkspaceRepository,Neos\ContentRepository\Domain\Repository $workspaceRepository
return Neos\ContentRepository\Domain\Repository\WorkspaceRepository