PHP 클래스 Neos\Neos\Domain\Service\UserService

파일 보기 프로젝트 열기: neos/neos-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$accountFactory Neos\Flow\Security\AccountFactory
$accountRepository Neos\Flow\Security\AccountRepository
$authenticationManager Neos\Flow\Security\Authentication\AuthenticationManagerInterface
$defaultAuthenticationProviderName string Might be configurable in the future, for now centralising this as a "constant"
$hashService Neos\Flow\Security\Cryptography\HashService
$now Neos\Flow\Utility\Now
$partyRepository Neos\Party\Domain\Repository\PartyRepository
$partyService Neos\Party\Domain\Service\PartyService
$policyService Neos\Flow\Security\Policy\PolicyService
$privilegeManager Neos\Flow\Security\Authorization\PrivilegeManagerInterface
$publishingService Neos\Neos\Service\PublishingService
$runtimeUserCache array
$securityContext Neos\Flow\Security\Context
$userRepository Neos\Neos\Domain\Repository\UserRepository
$workspaceRepository Neos\ContentRepository\Domain\Repository\WorkspaceRepository

공개 메소드들

메소드 설명
activateUser ( User $user ) : void Reactivates the given user
addRoleToAccount ( Account $account, string $roleIdentifier ) : integer Adds the specified role to the given account and potentially carries out further actions which are needed to properly reflect these changes.
addRoleToUser ( User $user, string $roleIdentifier ) : integer Adds the specified role to all accounts of the given user and potentially carries out further actions which are needed to properly reflect these changes.
addUser ( string $username, string $password, User $user, array $roleIdentifiers = null, string $authenticationProviderName = null ) : User Adds a user whose User object has been created elsewhere
createUser ( string $username, string $password, string $firstName, string $lastName, array $roleIdentifiers = null, string $authenticationProviderName = null ) : User Creates a user based on the given information
currentUserCanManageWorkspace ( Workspace $workspace ) : boolean Checks if the current user may manage the given workspace according to one the roles of the user's accounts
currentUserCanPublishToWorkspace ( Workspace $workspace ) : boolean Checks if the current user may publish to the given workspace according to one the roles of the user's accounts
currentUserCanReadWorkspace ( Workspace $workspace ) : boolean Checks if the current user may read the given workspace according to one the roles of the user's accounts
currentUserCanTransferOwnershipOfWorkspace ( Workspace $workspace ) : boolean Checks if the current user may transfer ownership of the given workspace
deactivateUser ( User $user ) : void Deactivates the given user
deleteUser ( User $user ) : void Deletes the specified user and all remaining content in his personal workspaces
emitRolesAdded ( Account $account, array $roles ) : void Signals that new roles have been assigned to the given account
emitRolesRemoved ( Account $account, array $roles ) : void Signals that roles have been removed to the given account
emitUserActivated ( User $user ) : void Signals that the given user has been activated
emitUserCreated ( User $user ) : void Signals that a new user, including a new account has been created.
emitUserDeactivated ( User $user ) : void Signals that the given user has been activated
emitUserDeleted ( User $user ) : void Signals that the given user has been deleted.
emitUserUpdated ( User $user ) : void Signals that the given user data has been updated.
getCurrentUser ( ) : User Returns the currently logged in user, if any
getDefaultAuthenticationProviderName ( ) : string Returns the default authentication provider name
getUser ( string $username, string $authenticationProviderName = null ) : User Retrieves an existing user by the given username
getUsername ( User $user, string $authenticationProviderName = null ) : string Returns the username of the given user
getUsers ( ) : array Retrieves a list of all existing users
removeRoleFromAccount ( Account $account, string $roleIdentifier ) : integer Removes the specified role from the given account and potentially carries out further actions which are needed to properly reflect these changes.
removeRoleFromUser ( User $user, string $roleIdentifier ) : integer Removes the specified role from all accounts of the given user and potentially carries out further actions which are needed to properly reflect these changes.
setRolesForAccount ( Account $account, array $newRoleIdentifiers ) : void Overrides any assigned roles of the given account and potentially carries out further actions which are needed to properly reflect these changes.
setUserPassword ( User $user, string $password ) : void Sets a new password for the given user
updateUser ( User $user ) : void Updates the given user in the respective repository and potentially executes further actions depending on what has been changed.

보호된 메소드들

메소드 설명
createPersonalWorkspace ( User $user, Account $account ) Creates a personal workspace for the given user's account if it does not exist already.
deletePersonalWorkspace ( string $accountIdentifier ) : void Removes all personal workspaces of the given user's account if these workspaces exist. Also removes all possibly existing content of these workspaces.
getAllRoles ( User $user ) : array Returns an array with all roles of a user's accounts, including parent roles, the "Everybody" role and the "AuthenticatedUser" role, assuming that the user is logged in.
normalizeRoleIdentifier ( string $roleIdentifier ) : string Replaces a role identifier not containing a "." into fully qualified role identifier from the Neos.Neos namespace.
normalizeRoleIdentifiers ( array $roleIdentifiers ) : array Replaces role identifiers not containing a "." into fully qualified role identifiers from the Neos.Neos namespace.
removeOwnerFromUsersWorkspaces ( User $user ) : void Removes ownership of all workspaces currently owned by the given user

메소드 상세

activateUser() 공개 메소드

Reactivates the given user
public activateUser ( User $user ) : void
$user Neos\Neos\Domain\Model\User The user to deactivate
리턴 void

addRoleToAccount() 공개 메소드

Adds the specified role to the given account and potentially carries out further actions which are needed to properly reflect these changes.
public addRoleToAccount ( Account $account, string $roleIdentifier ) : integer
$account Neos\Flow\Security\Account The account to add roles to
$roleIdentifier string A fully qualified role identifier, or a role identifier relative to the Neos.Neos namespace
리턴 integer How often this role has been added to the given account (effectively can be 1 or 0)

addRoleToUser() 공개 메소드

Adds the specified role to all accounts of the given user and potentially carries out further actions which are needed to properly reflect these changes.
public addRoleToUser ( User $user, string $roleIdentifier ) : integer
$user Neos\Neos\Domain\Model\User The user to add roles to
$roleIdentifier string A fully qualified role identifier, or a role identifier relative to the Neos.Neos namespace
리턴 integer How often this role has been added to accounts owned by the user

addUser() 공개 메소드

This method basically "creates" a user like createUser() would, except that it does not create the User object itself. If you need to create the User object elsewhere, for example in your ActionController, make sure to call this method for registering the new user instead of adding it to the PartyRepository manually. This method also creates a new user workspace for the given user if no such workspace exist.
public addUser ( string $username, string $password, User $user, array $roleIdentifiers = null, string $authenticationProviderName = null ) : User
$username string The username of the user to be created.
$password string Password of the user to be created
$user Neos\Neos\Domain\Model\User The pre-built user object to start with
$roleIdentifiers array A list of role identifiers to assign
$authenticationProviderName string Name of the authentication provider to use. Example: "Typo3BackendProvider"
리턴 Neos\Neos\Domain\Model\User The same user object

createPersonalWorkspace() 보호된 메소드

Creates a personal workspace for the given user's account if it does not exist already.
protected createPersonalWorkspace ( User $user, Account $account )
$user Neos\Neos\Domain\Model\User The new user to create a workspace for
$account Neos\Flow\Security\Account The user's backend account

createUser() 공개 메소드

The created user and account are automatically added to their respective repositories and thus be persisted.
public createUser ( string $username, string $password, string $firstName, string $lastName, array $roleIdentifiers = null, string $authenticationProviderName = null ) : User
$username string The username of the user to be created.
$password string Password of the user to be created
$firstName string First name of the user to be created
$lastName string Last name of the user to be created
$roleIdentifiers array A list of role identifiers to assign
$authenticationProviderName string Name of the authentication provider to use. Example: "Typo3BackendProvider"
리턴 Neos\Neos\Domain\Model\User The created user instance

currentUserCanManageWorkspace() 공개 메소드

In future versions, this logic may be implemented in Neos in a more generic way (for example, by means of an ACL object), but for now, this method exists in order to at least centralize and encapsulate the required logic.
public currentUserCanManageWorkspace ( Workspace $workspace ) : boolean
$workspace Neos\ContentRepository\Domain\Model\Workspace The workspace
리턴 boolean

currentUserCanPublishToWorkspace() 공개 메소드

In future versions, this logic may be implemented in Neos in a more generic way (for example, by means of an ACL object), but for now, this method exists in order to at least centralize and encapsulate the required logic.
public currentUserCanPublishToWorkspace ( Workspace $workspace ) : boolean
$workspace Neos\ContentRepository\Domain\Model\Workspace The workspace
리턴 boolean

currentUserCanReadWorkspace() 공개 메소드

In future versions, this logic may be implemented in Neos in a more generic way (for example, by means of an ACL object), but for now, this method exists in order to at least centralize and encapsulate the required logic.
public currentUserCanReadWorkspace ( Workspace $workspace ) : boolean
$workspace Neos\ContentRepository\Domain\Model\Workspace The workspace
리턴 boolean

currentUserCanTransferOwnershipOfWorkspace() 공개 메소드

In future versions, this logic may be implemented in Neos in a more generic way (for example, by means of an ACL object), but for now, this method exists in order to at least centralize and encapsulate the required logic.
public currentUserCanTransferOwnershipOfWorkspace ( Workspace $workspace ) : boolean
$workspace Neos\ContentRepository\Domain\Model\Workspace The workspace
리턴 boolean

deactivateUser() 공개 메소드

Deactivates the given user
public deactivateUser ( User $user ) : void
$user Neos\Neos\Domain\Model\User The user to deactivate
리턴 void

deletePersonalWorkspace() 보호된 메소드

Removes all personal workspaces of the given user's account if these workspaces exist. Also removes all possibly existing content of these workspaces.
protected deletePersonalWorkspace ( string $accountIdentifier ) : void
$accountIdentifier string Identifier of the user's account
리턴 void

deleteUser() 공개 메소드

Deletes the specified user and all remaining content in his personal workspaces
public deleteUser ( User $user ) : void
$user Neos\Neos\Domain\Model\User The user to delete
리턴 void

emitRolesAdded() 공개 메소드

Signals that new roles have been assigned to the given account
public emitRolesAdded ( Account $account, array $roles ) : void
$account Neos\Flow\Security\Account The account
$roles array
리턴 void

emitRolesRemoved() 공개 메소드

Signals that roles have been removed to the given account
public emitRolesRemoved ( Account $account, array $roles ) : void
$account Neos\Flow\Security\Account The account
$roles array
리턴 void

emitUserActivated() 공개 메소드

Signals that the given user has been activated
public emitUserActivated ( User $user ) : void
$user Neos\Neos\Domain\Model\User The user
리턴 void

emitUserCreated() 공개 메소드

Signals that a new user, including a new account has been created.
public emitUserCreated ( User $user ) : void
$user Neos\Neos\Domain\Model\User The created user
리턴 void

emitUserDeactivated() 공개 메소드

Signals that the given user has been activated
public emitUserDeactivated ( User $user ) : void
$user Neos\Neos\Domain\Model\User The user
리턴 void

emitUserDeleted() 공개 메소드

Signals that the given user has been deleted.
public emitUserDeleted ( User $user ) : void
$user Neos\Neos\Domain\Model\User The created user
리턴 void

emitUserUpdated() 공개 메소드

Signals that the given user data has been updated.
public emitUserUpdated ( User $user ) : void
$user Neos\Neos\Domain\Model\User The created user
리턴 void

getAllRoles() 보호된 메소드

Returns an array with all roles of a user's accounts, including parent roles, the "Everybody" role and the "AuthenticatedUser" role, assuming that the user is logged in.
protected getAllRoles ( User $user ) : array
$user Neos\Neos\Domain\Model\User The user
리턴 array

getCurrentUser() 공개 메소드

Returns the currently logged in user, if any
public getCurrentUser ( ) : User
리턴 Neos\Neos\Domain\Model\User The currently logged in user, or null

getDefaultAuthenticationProviderName() 공개 메소드

Returns the default authentication provider name

getUser() 공개 메소드

Retrieves an existing user by the given username
public getUser ( string $username, string $authenticationProviderName = null ) : User
$username string The username
$authenticationProviderName string Name of the authentication provider to use. Example: "Typo3BackendProvider"
리턴 Neos\Neos\Domain\Model\User The user, or null if the user does not exist

getUsername() 공개 메소드

Technically, this method will look for the user's backend account (or, if authenticationProviderName is specified, for the account matching the given authentication provider) and return the account's identifier.
public getUsername ( User $user, string $authenticationProviderName = null ) : string
$user Neos\Neos\Domain\Model\User
$authenticationProviderName string
리턴 string The username or null if the given user does not have a backend account

getUsers() 공개 메소드

Retrieves a list of all existing users
public getUsers ( ) : array
리턴 array

normalizeRoleIdentifier() 보호된 메소드

Replaces a role identifier not containing a "." into fully qualified role identifier from the Neos.Neos namespace.
protected normalizeRoleIdentifier ( string $roleIdentifier ) : string
$roleIdentifier string
리턴 string

normalizeRoleIdentifiers() 보호된 메소드

Replaces role identifiers not containing a "." into fully qualified role identifiers from the Neos.Neos namespace.
protected normalizeRoleIdentifiers ( array $roleIdentifiers ) : array
$roleIdentifiers array
리턴 array

removeOwnerFromUsersWorkspaces() 보호된 메소드

Removes ownership of all workspaces currently owned by the given user
protected removeOwnerFromUsersWorkspaces ( User $user ) : void
$user Neos\Neos\Domain\Model\User The user currently owning workspaces
리턴 void

removeRoleFromAccount() 공개 메소드

Removes the specified role from the given account and potentially carries out further actions which are needed to properly reflect these changes.
public removeRoleFromAccount ( Account $account, string $roleIdentifier ) : integer
$account Neos\Flow\Security\Account The account to remove roles from
$roleIdentifier string A fully qualified role identifier, or a role identifier relative to the Neos.Neos namespace
리턴 integer How often this role has been removed from the given account (effectively can be 1 or 0)

removeRoleFromUser() 공개 메소드

Removes the specified role from all accounts of the given user and potentially carries out further actions which are needed to properly reflect these changes.
public removeRoleFromUser ( User $user, string $roleIdentifier ) : integer
$user Neos\Neos\Domain\Model\User The user to remove roles from
$roleIdentifier string A fully qualified role identifier, or a role identifier relative to the Neos.Neos namespace
리턴 integer How often this role has been removed from accounts owned by the user

setRolesForAccount() 공개 메소드

Overrides any assigned roles of the given account and potentially carries out further actions which are needed to properly reflect these changes.
public setRolesForAccount ( Account $account, array $newRoleIdentifiers ) : void
$account Neos\Flow\Security\Account The account to assign the roles to
$newRoleIdentifiers array A list of fully qualified role identifiers, or role identifiers relative to the Neos.Neos namespace
리턴 void

setUserPassword() 공개 메소드

This method will iterate over all accounts owned by the given user and, if the account uses a UsernamePasswordToken, sets a new password accordingly.
public setUserPassword ( User $user, string $password ) : void
$user Neos\Neos\Domain\Model\User The user to set the password for
$password string A new password
리턴 void

updateUser() 공개 메소드

Note: changes to the user's account will not be committed for persistence. Please use addRoleToAccount(), removeRoleFromAccount(), setRolesForAccount() and setUserPassword() for changing account properties.
public updateUser ( User $user ) : void
$user Neos\Neos\Domain\Model\User The modified user
리턴 void

프로퍼티 상세

$accountFactory 보호되어 있는 프로퍼티

protected AccountFactory,Neos\Flow\Security $accountFactory
리턴 Neos\Flow\Security\AccountFactory

$accountRepository 보호되어 있는 프로퍼티

protected AccountRepository,Neos\Flow\Security $accountRepository
리턴 Neos\Flow\Security\AccountRepository

$authenticationManager 보호되어 있는 프로퍼티

protected AuthenticationManagerInterface,Neos\Flow\Security\Authentication $authenticationManager
리턴 Neos\Flow\Security\Authentication\AuthenticationManagerInterface

$defaultAuthenticationProviderName 보호되어 있는 프로퍼티

Might be configurable in the future, for now centralising this as a "constant"
protected string $defaultAuthenticationProviderName
리턴 string

$hashService 보호되어 있는 프로퍼티

protected HashService,Neos\Flow\Security\Cryptography $hashService
리턴 Neos\Flow\Security\Cryptography\HashService

$now 보호되어 있는 프로퍼티

protected Now,Neos\Flow\Utility $now
리턴 Neos\Flow\Utility\Now

$partyRepository 보호되어 있는 프로퍼티

protected PartyRepository,Neos\Party\Domain\Repository $partyRepository
리턴 Neos\Party\Domain\Repository\PartyRepository

$partyService 보호되어 있는 프로퍼티

protected PartyService,Neos\Party\Domain\Service $partyService
리턴 Neos\Party\Domain\Service\PartyService

$policyService 보호되어 있는 프로퍼티

protected PolicyService,Neos\Flow\Security\Policy $policyService
리턴 Neos\Flow\Security\Policy\PolicyService

$privilegeManager 보호되어 있는 프로퍼티

protected PrivilegeManagerInterface,Neos\Flow\Security\Authorization $privilegeManager
리턴 Neos\Flow\Security\Authorization\PrivilegeManagerInterface

$publishingService 보호되어 있는 프로퍼티

protected PublishingService,Neos\Neos\Service $publishingService
리턴 Neos\Neos\Service\PublishingService

$runtimeUserCache 보호되어 있는 프로퍼티

protected array $runtimeUserCache
리턴 array

$securityContext 보호되어 있는 프로퍼티

protected Context,Neos\Flow\Security $securityContext
리턴 Neos\Flow\Security\Context

$userRepository 보호되어 있는 프로퍼티

protected UserRepository,Neos\Neos\Domain\Repository $userRepository
리턴 Neos\Neos\Domain\Repository\UserRepository

$workspaceRepository 보호되어 있는 프로퍼티

protected WorkspaceRepository,Neos\ContentRepository\Domain\Repository $workspaceRepository
리턴 Neos\ContentRepository\Domain\Repository\WorkspaceRepository