Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
eZ\Publish\Core\REST\Server\Controller\User Class Reference

User controller. More...

Inheritance diagram for eZ\Publish\Core\REST\Server\Controller\User:

## Public Member Functions
| __construct (UserService $userService, RoleService $roleService, ContentService $contentService, ContentTypeService $contentTypeService, LocationService $locationService, SectionService $sectionService, Repository $repository)
| Construct controller. More...
| loadRootUserGroup ()
| Redirects to the root user group. More...
| loadUserGroup ($groupPath)
| Loads a user group for the given path. More...
| loadUser ($userId)
| Loads a user for the given ID. More...
| createUserGroup ($groupPath, Request $request)
| Create a new user group under the given parent To create a top level group use /user/groups/1/5/subgroups. More...
| createUser ($groupPath, Request $request)
| Create a new user group in the given group. More...
| updateUserGroup ($groupPath, Request $request)
| Updates a user group. More...
| updateUser ($userId, Request $request)
| Updates a user. More...
| deleteUserGroup ($groupPath)
| Given user group is deleted. More...
| deleteUser ($userId)
| Given user is deleted. More...
| loadUsers (Request $request)
| Loads users. More...
| verifyUsers (Request $request)
| loadUsersAssignedToRole ($roleId)
| Loads a list of users assigned to role. More...
| loadUserGroups (Request $request)
| Loads user groups. More...
| loadUserGroupByRemoteId (Request $request)
| Loads a user group by its remote ID. More...
| loadUserGroupsAssignedToRole ($roleId)
| Loads a list of user groups assigned to role. More...
| loadUserDrafts ($userId, Request $request)
| Loads drafts assigned to user. More...
| moveUserGroup ($groupPath, Request $request)
| Moves the user group to another parent. More...
| loadSubUserGroups ($groupPath, Request $request)
| Returns a list of the sub groups. More...
| loadUserGroupsOfUser ($userId, Request $request)
| Returns a list of user groups the user belongs to. More...
| loadUsersFromGroup ($groupPath, Request $request)
| Loads the users of the group with the given path. More...
| unassignUserFromUserGroup ($userId, $groupPath)
| Unassigns the user from a user group. More...
| assignUserToUserGroup ($userId, Request $request)
| Assigns the user to a user group. More...
| createSession (Request $request)
| Creates a new session based on the credentials provided as POST parameters. More...
| refreshSession ($sessionId, Request $request)
| Refresh given session. More...
| deleteSession ($sessionId, Request $request)
| Deletes given session. More...
| setTokenStorage (TokenStorageInterface $csrfTokenStorage)
| setSessionController (SessionController $sessionController)
Public Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
| setInputDispatcher (InputDispatcher $inputDispatcher)
| setRouter (RouterInterface $router)
| setRepository (Repository $repository)
| setRequestParser (RequestParser $requestParser)

## Protected Attributes
| $userService
| $roleService
| $contentService
| $contentTypeService
| $locationService
| $sectionService
| $repository
Protected Attributes inherited from eZ\Publish\Core\REST\Server\Controller
| $inputDispatcher
| $router
| $requestParser
| $repository

## Private Member Functions
| buildRestUserObject (RepositoryUser $user)
| extractLocationIdFromPath ($path)
| Extracts and returns an item id from a path, e.g. More...

## Private Attributes
| $csrfTokenStorage
| $sessionController

## Additional Inherited Members
Protected Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
| getMediaType (Request $request)
| Extracts the requested media type from $request. More...

## Detailed Description

User controller.

Definition at line 34 of file Publish/Core/REST/Server/Controller/User.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\REST\Server\Controller\User::__construct | ( | UserService | $userService,
|  | RoleService | $roleService,
|  | ContentService | $contentService,
|  | ContentTypeService | $contentTypeService,
|  | LocationService | $locationService,
|  | SectionService | $sectionService,
|  | Repository | $repository
| ) |  |

Construct controller.

Parameters

  \eZ\Publish\API\Repository\UserService | $userService |
  \eZ\Publish\API\Repository\RoleService | $roleService |
  \eZ\Publish\API\Repository\ContentService | $contentService |
  \eZ\Publish\API\Repository\LocationService | $locationService |
  \eZ\Publish\API\Repository\SectionService | $sectionService |
  \eZ\Publish\API\Repository\Repository | $repository |

Definition at line 109 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\$contentService, eZ\Publish\Core\REST\Server\Controller\User\$contentTypeService, eZ\Publish\Core\REST\Server\Controller\User\$locationService, eZ\Publish\Core\REST\Server\Controller\User\$repository, eZ\Publish\Core\REST\Server\Controller\User\$roleService, eZ\Publish\Core\REST\Server\Controller\User\$sectionService, and eZ\Publish\Core\REST\Server\Controller\User\$userService.

## Member Function Documentation

## ◆ assignUserToUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::assignUserToUserGroup | ( |  | $userId,
|  | Request | $request
| ) |  |

Assigns the user to a user group.

Parameters

  $userId |

Exceptions

Definition at line 926 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath().

## ◆ buildRestUserObject()

eZ\Publish\Core\REST\Server\Controller\User::buildRestUserObject | ( | RepositoryUser | $user | ) |
| private

Returns
  Values\RestUser

Definition at line 542 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\loadUsers(), and eZ\Publish\Core\REST\Server\Controller\User\loadUsersAssignedToRole().

## ◆ createSession()

eZ\Publish\Core\REST\Server\Controller\User::createSession | ( | Request | $request | ) |

Creates a new session based on the credentials provided as POST parameters.

Exceptions

Definition at line 987 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ createUser()

eZ\Publish\Core\REST\Server\Controller\User::createUser | ( |  | $groupPath,
|  | Request | $request
| ) |  |

Create a new user group in the given group.

Parameters

  $groupPath |

Exceptions

Definition at line 276 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath().

## ◆ createUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::createUserGroup | ( |  | $groupPath,
|  | Request | $request
| ) |  |

Create a new user group under the given parent To create a top level group use /user/groups/1/5/subgroups.

Parameters

  $groupPath |

Exceptions

Definition at line 232 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath().

## ◆ deleteSession()

eZ\Publish\Core\REST\Server\Controller\User::deleteSession | ( |  | $sessionId,
|  | Request | $request
| ) |  |

Deletes given session.

Parameters

  string | $sessionId |

Returns
  Values\DeletedUserSession|\Symfony\Component\HttpFoundation\Response

Exceptions

Definition at line 1030 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ deleteUser()

eZ\Publish\Core\REST\Server\Controller\User::deleteUser | ( |  | $userId | ) |

Given user is deleted.

Parameters

  $userId |

Exceptions

Definition at line 446 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ deleteUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::deleteUserGroup | ( |  | $groupPath | ) |

Given user group is deleted.

Parameters

  $groupPath |

Exceptions

Definition at line 416 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath().

## ◆ extractLocationIdFromPath()

eZ\Publish\Core\REST\Server\Controller\User::extractLocationIdFromPath | ( |  | $path | ) |
| private

Extracts and returns an item id from a path, e.g.

/1/2/58 => 58.

Parameters

  string | $path |

Returns
  mixed

Definition at line 1047 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\assignUserToUserGroup(), eZ\Publish\Core\REST\Server\Controller\User\createUser(), eZ\Publish\Core\REST\Server\Controller\User\createUserGroup(), eZ\Publish\Core\REST\Server\Controller\User\deleteUserGroup(), eZ\Publish\Core\REST\Server\Controller\User\loadSubUserGroups(), eZ\Publish\Core\REST\Server\Controller\User\loadUserGroup(), eZ\Publish\Core\REST\Server\Controller\User\loadUsersFromGroup(), eZ\Publish\Core\REST\Server\Controller\User\moveUserGroup(), and eZ\Publish\Core\REST\Server\Controller\User\updateUserGroup().

## ◆ loadRootUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::loadRootUserGroup | ( |  | ) |

Redirects to the root user group.

Returns
  \eZ\Publish\Core\REST\Server\Values\PermanentRedirect

Definition at line 132 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ loadSubUserGroups()

eZ\Publish\Core\REST\Server\Controller\User::loadSubUserGroups | ( |  | $groupPath,
|  | Request | $request
| ) |  |

Returns a list of the sub groups.

Parameters

  $groupPath |

Returns
  \eZ\Publish\Core\REST\Server\Values\UserGroupList|\eZ\Publish\Core\REST\Server\Values\UserGroupRefList

Definition at line 719 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath(), and eZ\Publish\Core\REST\Server\Controller\getMediaType().

## ◆ loadUser()

eZ\Publish\Core\REST\Server\Controller\User::loadUser | ( |  | $userId | ) |

Loads a user for the given ID.

Parameters

  $userId |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestUser

Definition at line 185 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ loadUserDrafts()

eZ\Publish\Core\REST\Server\Controller\User::loadUserDrafts | ( |  | $userId,
|  | Request | $request
| ) |  |

Loads drafts assigned to user.

Parameters

  $userId |

Returns
  \eZ\Publish\Core\REST\Server\Values\VersionList

Definition at line 653 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ loadUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::loadUserGroup | ( |  | $groupPath | ) |

Loads a user group for the given path.

Parameters

  $groupPath |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestUserGroup

Definition at line 147 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath().

## ◆ loadUserGroupByRemoteId()

eZ\Publish\Core\REST\Server\Controller\User::loadUserGroupByRemoteId | ( | Request | $request | ) |

Loads a user group by its remote ID.

Returns
  \eZ\Publish\Core\REST\Server\Values\RestUserGroup

Definition at line 596 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\loadUserGroups().

## ◆ loadUserGroups()

eZ\Publish\Core\REST\Server\Controller\User::loadUserGroups | ( | Request | $request | ) |

Loads user groups.

Returns
  \eZ\Publish\Core\REST\Server\Values\UserGroupList|\eZ\Publish\Core\REST\Server\Values\UserGroupRefList

Definition at line 558 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\getMediaType(), eZ\Publish\Core\REST\Server\Controller\User\loadUserGroupByRemoteId(), and eZ\Publish\Core\REST\Server\Controller\User\loadUserGroupsAssignedToRole().

## ◆ loadUserGroupsAssignedToRole()

eZ\Publish\Core\REST\Server\Controller\User::loadUserGroupsAssignedToRole | ( |  | $roleId | ) |

Loads a list of user groups assigned to role.

Parameters

  mixed | $roleId |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestUserGroup[]

Definition at line 619 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\loadUserGroups().

## ◆ loadUserGroupsOfUser()

eZ\Publish\Core\REST\Server\Controller\User::loadUserGroupsOfUser | ( |  | $userId,
|  | Request | $request
| ) |  |

Returns a list of user groups the user belongs to.

The returned list includes the resources for unassigning a user group if the user is in multiple groups.

Parameters

  $userId |

Returns
  \eZ\Publish\Core\REST\Server\Values\UserGroupRefList

Definition at line 776 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ loadUsers()

eZ\Publish\Core\REST\Server\Controller\User::loadUsers | ( | Request | $request | ) |

Loads users.

Returns
  \eZ\Publish\Core\REST\Server\Values\UserList|\eZ\Publish\Core\REST\Server\Values\UserRefList

Definition at line 464 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\buildRestUserObject(), eZ\Publish\Core\REST\Server\Controller\getMediaType(), and eZ\Publish\Core\REST\Server\Controller\User\loadUsersAssignedToRole().

Referenced by eZ\Publish\Core\REST\Server\Controller\User\verifyUsers().

## ◆ loadUsersAssignedToRole()

eZ\Publish\Core\REST\Server\Controller\User::loadUsersAssignedToRole | ( |  | $roleId | ) |

Loads a list of users assigned to role.

Parameters

  mixed | $roleId |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestUser[]

Definition at line 523 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\buildRestUserObject().

Referenced by eZ\Publish\Core\REST\Server\Controller\User\loadUsers().

## ◆ loadUsersFromGroup()

eZ\Publish\Core\REST\Server\Controller\User::loadUsersFromGroup | ( |  | $groupPath,
|  | Request | $request
| ) |  |

Loads the users of the group with the given path.

Parameters

  $groupPath |

Returns
  \eZ\Publish\Core\REST\Server\Values\UserList|\eZ\Publish\Core\REST\Server\Values\UserRefList

Definition at line 817 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath(), and eZ\Publish\Core\REST\Server\Controller\getMediaType().

## ◆ moveUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::moveUserGroup | ( |  | $groupPath,
|  | Request | $request
| ) |  |

Moves the user group to another parent.

Parameters

  $groupPath |

Exceptions

Definition at line 671 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath().

## ◆ refreshSession()

eZ\Publish\Core\REST\Server\Controller\User::refreshSession | ( |  | $sessionId,
|  | Request | $request
| ) |  |

Refresh given session.

Parameters

  string | $sessionId |

Exceptions

Definition at line 1008 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ setSessionController()

eZ\Publish\Core\REST\Server\Controller\User::setSessionController | ( | SessionController | $sessionController | ) |

Definition at line 1064 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\$sessionController.

## ◆ setTokenStorage()

eZ\Publish\Core\REST\Server\Controller\User::setTokenStorage | ( | TokenStorageInterface | $csrfTokenStorage | ) |

Definition at line 1054 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\$csrfTokenStorage.

## ◆ unassignUserFromUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::unassignUserFromUserGroup | ( |  | $userId,
|  |  | $groupPath
| ) |  |

Unassigns the user from a user group.

Parameters

  $userId |
  $groupPath |

Exceptions

Definition at line 875 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ updateUser()

eZ\Publish\Core\REST\Server\Controller\User::updateUser | ( |  | $userId,
|  | Request | $request
| ) |  |

Updates a user.

Parameters

  $userId |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestUser

Definition at line 370 of file Publish/Core/REST/Server/Controller/User.php.

## ◆ updateUserGroup()

eZ\Publish\Core\REST\Server\Controller\User::updateUserGroup | ( |  | $groupPath,
|  | Request | $request
| ) |  |

Updates a user group.

Parameters

  $groupPath |

Returns
  \eZ\Publish\Core\REST\Server\Values\RestUserGroup

Definition at line 320 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\extractLocationIdFromPath().

## ◆ verifyUsers()

eZ\Publish\Core\REST\Server\Controller\User::verifyUsers | ( | Request | $request | ) |

Definition at line 508 of file Publish/Core/REST/Server/Controller/User.php.

References eZ\Publish\Core\REST\Server\Controller\User\loadUsers().

## Member Data Documentation

## ◆ $contentService

eZ\Publish\Core\REST\Server\Controller\User::$contentService
| protected

Definition at line 55 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\__construct().

## ◆ $contentTypeService

eZ\Publish\Core\REST\Server\Controller\User::$contentTypeService
| protected

Definition at line 62 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\__construct().

## ◆ $csrfTokenStorage

eZ\Publish\Core\REST\Server\Controller\User::$csrfTokenStorage
| private

Definition at line 90 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\setTokenStorage().

## ◆ $locationService

eZ\Publish\Core\REST\Server\Controller\User::$locationService
| protected

Definition at line 69 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\__construct().

## ◆ $repository

eZ\Publish\Core\REST\Server\Controller\User::$repository
| protected

Definition at line 83 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\__construct().

## ◆ $roleService

eZ\Publish\Core\REST\Server\Controller\User::$roleService
| protected

Definition at line 48 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\__construct().

## ◆ $sectionService

eZ\Publish\Core\REST\Server\Controller\User::$sectionService
| protected

Definition at line 76 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\__construct().

## ◆ $sessionController

eZ\Publish\Core\REST\Server\Controller\User::$sessionController
| private

Definition at line 97 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\setSessionController().

## ◆ $userService

eZ\Publish\Core\REST\Server\Controller\User::$userService
| protected

Definition at line 41 of file Publish/Core/REST/Server/Controller/User.php.

Referenced by eZ\Publish\Core\REST\Server\Controller\User\__construct().

The documentation for this class was generated from the following file:

- Publish/Core/REST/Server/Controller/User.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.