PHP Class eZ\Publish\Core\REST\Server\Controller\User

Inheritance: extends eZ\Publish\Core\REST\Server\Controller
Mostrar archivo Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$contentService eZ\Publish\API\Repository\ContentService Content service.
$contentTypeService eZ\Publish\API\Repository\ContentTypeService Content service.
$locationService eZ\Publish\API\Repository\LocationService Location service.
$repository eZ\Publish\API\Repository\Repository Repository.
$roleService eZ\Publish\API\Repository\RoleService Role service.
$sectionService eZ\Publish\API\Repository\SectionService Section service.
$userService eZ\Publish\API\Repository\UserService User service.

Public Methods

Method Description
__construct ( eZ\Publish\API\Repository\UserService $userService, eZ\Publish\API\Repository\RoleService $roleService, eZ\Publish\API\Repository\ContentService $contentService, eZ\Publish\API\Repository\ContentTypeService $contentTypeService, eZ\Publish\API\Repository\LocationService $locationService, eZ\Publish\API\Repository\SectionService $sectionService, eZ\Publish\API\Repository\Repository $repository ) Construct controller.
assignUserToUserGroup ( $userId, Request $request ) : UserGroupRefList Assigns the user to a user group.
createSession ( Request $request ) : UserSession | eZ\Publish\Core\REST\Server\Values\Conflict Creates a new session based on the credentials provided as POST parameters.
createUser ( $groupPath, Request $request ) : CreatedUser Create a new user group in the given group.
createUserGroup ( $groupPath, Request $request ) : CreatedUserGroup Create a new user group under the given parent To create a top level group use /user/groups/1/5/subgroups.
deleteSession ( string $sessionId, Request $request ) : DeletedUserSession | Response Deletes given session.
deleteUser ( $userId ) : eZ\Publish\Core\REST\Server\Values\NoContent Given user is deleted.
deleteUserGroup ( $groupPath ) : eZ\Publish\Core\REST\Server\Values\NoContent Given user group is deleted.
loadRootUserGroup ( ) : PermanentRedirect Redirects to the root user group.
loadSubUserGroups ( $groupPath, Request $request ) : UserGroupList | UserGroupRefList Returns a list of the sub groups.
loadUser ( $userId ) : RestUser Loads a user for the given ID.
loadUserDrafts ( $userId, Request $request ) : VersionList Loads drafts assigned to user.
loadUserGroup ( $groupPath ) : RestUserGroup Loads a user group for the given path.
loadUserGroupByRemoteId ( Request $request ) : RestUserGroup Loads a user group by its remote ID.
loadUserGroups ( Request $request ) : UserGroupList | UserGroupRefList Loads user groups.
loadUserGroupsAssignedToRole ( mixed $roleId ) : RestUserGroup[] Loads a list of user groups assigned to role.
loadUserGroupsOfUser ( $userId, Request $request ) : UserGroupRefList Returns a list of user groups the user belongs to.
loadUsers ( Request $request ) : UserList | UserRefList Loads users.
loadUsersAssignedToRole ( mixed $roleId ) : RestUser[] Loads a list of users assigned to role.
loadUsersFromGroup ( $groupPath, Request $request ) : UserList | UserRefList Loads the users of the group with the given path.
moveUserGroup ( $groupPath, Request $request ) : ResourceCreated Moves the user group to another parent.
refreshSession ( string $sessionId, Request $request ) : UserSession Refresh given session.
setSessionController ( SessionController $sessionController )
setTokenStorage ( Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface $csrfTokenStorage )
unassignUserFromUserGroup ( $userId, $groupPath ) : UserGroupRefList Unassigns the user from a user group.
updateUser ( $userId, Request $request ) : RestUser Updates a user.
updateUserGroup ( $groupPath, Request $request ) : RestUserGroup Updates a user group.
verifyUsers ( Request $request )

Private Methods

Method Description
buildRestUserObject ( eZ\Publish\API\Repository\Values\User\User $user ) : RestUser
extractLocationIdFromPath ( string $path ) : mixed Extracts and returns an item id from a path, e.g. /1/2/58 => 58.

Method Details

__construct() public method

Construct controller.
public __construct ( eZ\Publish\API\Repository\UserService $userService, eZ\Publish\API\Repository\RoleService $roleService, eZ\Publish\API\Repository\ContentService $contentService, eZ\Publish\API\Repository\ContentTypeService $contentTypeService, eZ\Publish\API\Repository\LocationService $locationService, eZ\Publish\API\Repository\SectionService $sectionService, eZ\Publish\API\Repository\Repository $repository )
$userService eZ\Publish\API\Repository\UserService
$roleService eZ\Publish\API\Repository\RoleService
$contentService eZ\Publish\API\Repository\ContentService
$contentTypeService eZ\Publish\API\Repository\ContentTypeService
$locationService eZ\Publish\API\Repository\LocationService
$sectionService eZ\Publish\API\Repository\SectionService
$repository eZ\Publish\API\Repository\Repository

assignUserToUserGroup() public method

Assigns the user to a user group.
public assignUserToUserGroup ( $userId, Request $request ) : UserGroupRefList
$userId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserGroupRefList

createSession() public method

Creates a new session based on the credentials provided as POST parameters.
Deprecation: Deprecated since 6.5. Use SessionController::refreshSessionAction().
public createSession ( Request $request ) : UserSession | eZ\Publish\Core\REST\Server\Values\Conflict
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserSession | eZ\Publish\Core\REST\Server\Values\Conflict

createUser() public method

Create a new user group in the given group.
public createUser ( $groupPath, Request $request ) : CreatedUser
$groupPath
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\CreatedUser

createUserGroup() public method

Create a new user group under the given parent To create a top level group use /user/groups/1/5/subgroups.
public createUserGroup ( $groupPath, Request $request ) : CreatedUserGroup
$groupPath
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\CreatedUserGroup

deleteSession() public method

Deletes given session.
Deprecation: Deprecated since 6.5. Use SessionController::refreshSessionAction().
public deleteSession ( string $sessionId, Request $request ) : DeletedUserSession | Response
$sessionId string
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\DeletedUserSession | Symfony\Component\HttpFoundation\Response

deleteUser() public method

Given user is deleted.
public deleteUser ( $userId ) : eZ\Publish\Core\REST\Server\Values\NoContent
$userId
return eZ\Publish\Core\REST\Server\Values\NoContent

deleteUserGroup() public method

Given user group is deleted.
public deleteUserGroup ( $groupPath ) : eZ\Publish\Core\REST\Server\Values\NoContent
$groupPath
return eZ\Publish\Core\REST\Server\Values\NoContent

loadRootUserGroup() public method

Redirects to the root user group.
public loadRootUserGroup ( ) : PermanentRedirect
return eZ\Publish\Core\REST\Server\Values\PermanentRedirect

loadSubUserGroups() public method

Returns a list of the sub groups.
public loadSubUserGroups ( $groupPath, Request $request ) : UserGroupList | UserGroupRefList
$groupPath
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserGroupList | eZ\Publish\Core\REST\Server\Values\UserGroupRefList

loadUser() public method

Loads a user for the given ID.
public loadUser ( $userId ) : RestUser
$userId
return eZ\Publish\Core\REST\Server\Values\RestUser

loadUserDrafts() public method

Loads drafts assigned to user.
public loadUserDrafts ( $userId, Request $request ) : VersionList
$userId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\VersionList

loadUserGroup() public method

Loads a user group for the given path.
public loadUserGroup ( $groupPath ) : RestUserGroup
$groupPath
return eZ\Publish\Core\REST\Server\Values\RestUserGroup

loadUserGroupByRemoteId() public method

Loads a user group by its remote ID.
public loadUserGroupByRemoteId ( Request $request ) : RestUserGroup
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestUserGroup

loadUserGroups() public method

Loads user groups.
public loadUserGroups ( Request $request ) : UserGroupList | UserGroupRefList
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserGroupList | eZ\Publish\Core\REST\Server\Values\UserGroupRefList

loadUserGroupsAssignedToRole() public method

Loads a list of user groups assigned to role.
public loadUserGroupsAssignedToRole ( mixed $roleId ) : RestUserGroup[]
$roleId mixed
return eZ\Publish\Core\REST\Server\Values\RestUserGroup[]

loadUserGroupsOfUser() public method

The returned list includes the resources for unassigning a user group if the user is in multiple groups.
public loadUserGroupsOfUser ( $userId, Request $request ) : UserGroupRefList
$userId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserGroupRefList

loadUsers() public method

Loads users.
public loadUsers ( Request $request ) : UserList | UserRefList
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserList | eZ\Publish\Core\REST\Server\Values\UserRefList

loadUsersAssignedToRole() public method

Loads a list of users assigned to role.
public loadUsersAssignedToRole ( mixed $roleId ) : RestUser[]
$roleId mixed
return eZ\Publish\Core\REST\Server\Values\RestUser[]

loadUsersFromGroup() public method

Loads the users of the group with the given path.
public loadUsersFromGroup ( $groupPath, Request $request ) : UserList | UserRefList
$groupPath
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserList | eZ\Publish\Core\REST\Server\Values\UserRefList

moveUserGroup() public method

Moves the user group to another parent.
public moveUserGroup ( $groupPath, Request $request ) : ResourceCreated
$groupPath
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\ResourceCreated

refreshSession() public method

Refresh given session.
Deprecation: Deprecated since 6.5. Use SessionController::refreshSessionAction().
public refreshSession ( string $sessionId, Request $request ) : UserSession
$sessionId string
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\UserSession

setSessionController() public method

public setSessionController ( SessionController $sessionController )
$sessionController SessionController

setTokenStorage() public method

public setTokenStorage ( Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface $csrfTokenStorage )
$csrfTokenStorage Symfony\Component\Security\Csrf\TokenStorage\TokenStorageInterface

unassignUserFromUserGroup() public method

Unassigns the user from a user group.
public unassignUserFromUserGroup ( $userId, $groupPath ) : UserGroupRefList
$userId
$groupPath
return eZ\Publish\Core\REST\Server\Values\UserGroupRefList

updateUser() public method

Updates a user.
public updateUser ( $userId, Request $request ) : RestUser
$userId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestUser

updateUserGroup() public method

Updates a user group.
public updateUserGroup ( $groupPath, Request $request ) : RestUserGroup
$groupPath
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestUserGroup

verifyUsers() public method

public verifyUsers ( Request $request )
$request Symfony\Component\HttpFoundation\Request

Property Details

$contentService protected_oe property

Content service.
protected ContentService,eZ\Publish\API\Repository $contentService
return eZ\Publish\API\Repository\ContentService

$contentTypeService protected_oe property

Content service.
protected ContentTypeService,eZ\Publish\API\Repository $contentTypeService
return eZ\Publish\API\Repository\ContentTypeService

$locationService protected_oe property

Location service.
protected LocationService,eZ\Publish\API\Repository $locationService
return eZ\Publish\API\Repository\LocationService

$repository protected_oe property

Repository.
protected Repository,eZ\Publish\API\Repository $repository
return eZ\Publish\API\Repository\Repository

$roleService protected_oe property

Role service.
protected RoleService,eZ\Publish\API\Repository $roleService
return eZ\Publish\API\Repository\RoleService

$sectionService protected_oe property

Section service.
protected SectionService,eZ\Publish\API\Repository $sectionService
return eZ\Publish\API\Repository\SectionService

$userService protected_oe property

User service.
protected UserService,eZ\Publish\API\Repository $userService
return eZ\Publish\API\Repository\UserService