Class

eZ\Publish\Core\REST\Server\Controller\Role

class Role extends Controller

Role controller.

Methods

setInputDispatcher(Dispatcher $inputDispatcher)

from Controller
setRouter(RouterInterface $router)

from Controller
setRepository(Repository $repository)

from Controller
setRequestParser(RequestParser $requestParser)

from Controller
__construct(RoleService $roleService, UserService $userService, LocationService $locationService)

Construct controller.

CreatedRole createRole(Request $request)

Create new role.

CreatedRole createRoleDraft($roleId, Request $request)

Creates a new RoleDraft for an existing Role.

RoleList listRoles(Request $request)

Loads list of roles.

Role loadRole($roleId $roleId)

Loads role.

RoleDraft loadRoleDraft(mixed $roleId)

Loads a role draft.

Role updateRole($roleId, Request $request)

Updates a role.

RoleDraft updateRoleDraft($roleId, Request $request)

Updates a role draft.

PublishedRole publishRoleDraft(mixed $roleId)

Publishes a role draft.

NoContent deleteRole($roleId $roleId)

Delete a role by ID.

NoContent deleteRoleDraft($roleId $roleId)

Delete a role draft by ID.

PolicyList loadPolicies($roleId, Request $request)

Loads the policies for the role.

NoContent deletePolicies($roleId $roleId)

Deletes all policies from a role.

Policy loadPolicy($roleId, $policyId, Request $request)

Loads a policy.

CreatedPolicy addPolicy($roleId, Request $request)

Adds a policy to role.

CreatedPolicy addPolicyByRoleDraft($roleId, Request $request)

Adds a policy to a role draft.

Policy updatePolicy($roleId, $policyId, Request $request)

Updates a policy.

Policy updatePolicyByRoleDraft($roleId, $policyId, Request $request)

Updates a policy.

NoContent deletePolicy($roleId, $policyId, Request $request)

Delete a policy from role.

NoContent removePolicyByRoleDraft($roleId, $policyId, Request $request)

Remove a policy from a role draft.

RoleAssignmentList assignRoleToUser($userId, Request $request)

Assigns role to user.

RoleAssignmentList assignRoleToUserGroup($groupPath, Request $request)

Assigns role to user group.

RoleAssignmentList unassignRoleFromUser($userId $userId, $roleId $roleId)

Un-assigns role from user.

RoleAssignmentList unassignRoleFromUserGroup($groupPath $groupPath, $roleId $roleId)

Un-assigns role from user group.

RoleAssignmentList loadRoleAssignmentsForUser($userId $userId)

Loads role assignments for user.

RoleAssignmentList loadRoleAssignmentsForUserGroup($groupPath $groupPath)

Loads role assignments for user group.

RestUserRoleAssignment loadRoleAssignmentForUser($userId, $roleId, Request $request)

Returns a role assignment to the given user.

RestUserGroupRoleAssignment loadRoleAssignmentForUserGroup($groupPath, $roleId, Request $request)

Returns a role assignment to the given user group.

PolicyList listPoliciesForUser(Request $request)

Search all policies which are applied to a given user.

Details

in Controller at line 45
public setInputDispatcher(Dispatcher $inputDispatcher)

Parameters

Dispatcher $inputDispatcher

in Controller at line 50
public setRouter(RouterInterface $router)

Parameters

RouterInterface $router

in Controller at line 55
public setRepository(Repository $repository)

Parameters

Repository $repository

in Controller at line 60
public setRequestParser(RequestParser $requestParser)

Parameters

RequestParser $requestParser

at line 62
public __construct(RoleService $roleService, UserService $userService, LocationService $locationService)

Construct controller.

Parameters

RoleService $roleService
UserService $userService
LocationService $locationService

at line 79
public CreatedRole createRole(Request $request)

Create new role.

Defaults to publishing the role, but you can create a draft instead by setting the POST parameter publish=false

Parameters

Request $request

Return Value

CreatedRole

at line 137
public CreatedRole createRoleDraft($roleId, Request $request)

Creates a new RoleDraft for an existing Role.

Parameters

$roleId
Request $request

Return Value

CreatedRole

Exceptions

ForbiddenException if the Role already has a Role Draft that will need to be removed first, or if the authenticated user is not allowed to create a role
BadRequestException if a policy limitation in the $roleCreateStruct is not valid

at line 161
public RoleList listRoles(Request $request)

Loads list of roles.

Parameters

Request $request

Return Value

RoleList

at line 192
public Role loadRole($roleId $roleId)

Loads role.

Parameters

$roleId $roleId

Return Value

Role

at line 204
public RoleDraft loadRoleDraft(mixed $roleId)

Loads a role draft.

Parameters

mixed $roleId Original role ID, or ID of the role draft itself

Return Value

RoleDraft

at line 223
public Role updateRole($roleId, Request $request)

Updates a role.

Parameters

$roleId
Request $request

Return Value

Role

at line 245
public RoleDraft updateRoleDraft($roleId, Request $request)

Updates a role draft.

Parameters

$roleId
Request $request

Return Value

RoleDraft

at line 273
public PublishedRole publishRoleDraft(mixed $roleId)

Publishes a role draft.

Parameters

mixed $roleId Original role ID, or ID of the role draft itself

Return Value

PublishedRole

at line 298
public NoContent deleteRole($roleId $roleId)

Delete a role by ID.

Parameters

$roleId $roleId

Return Value

NoContent

at line 316
public NoContent deleteRoleDraft($roleId $roleId)

Delete a role draft by ID.

Parameters

$roleId $roleId

Return Value

NoContent

at line 332
public PolicyList loadPolicies($roleId, Request $request)

Loads the policies for the role.

Parameters

$roleId
Request $request

Return Value

PolicyList

at line 346
public NoContent deletePolicies($roleId $roleId)

Deletes all policies from a role.

Parameters

$roleId $roleId

Return Value

NoContent

at line 367
public Policy loadPolicy($roleId, $policyId, Request $request)

Loads a policy.

Parameters

$roleId
$policyId
Request $request

Return Value

Policy

Exceptions

NotFoundException

at line 386
public CreatedPolicy addPolicy($roleId, Request $request)

Adds a policy to role.

Parameters

$roleId
Request $request

Return Value

CreatedPolicy

at line 428
public CreatedPolicy addPolicyByRoleDraft($roleId, Request $request)

Adds a policy to a role draft.

Parameters

$roleId
Request $request

Return Value

CreatedPolicy

at line 487
public Policy updatePolicy($roleId, $policyId, Request $request)

Updates a policy.

Parameters

$roleId
$policyId
Request $request

Return Value

Policy

Exceptions

NotFoundException

at line 544
public Policy updatePolicyByRoleDraft($roleId, $policyId, Request $request)

Updates a policy.

Parameters

$roleId
$policyId
Request $request

Return Value

Policy

Exceptions

NotFoundException

at line 580
public NoContent deletePolicy($roleId, $policyId, Request $request)

Delete a policy from role.

Parameters

$roleId
$policyId
Request $request

Return Value

NoContent

Exceptions

NotFoundException

at line 634
public NoContent removePolicyByRoleDraft($roleId, $policyId, Request $request)

Remove a policy from a role draft.

Parameters

$roleId
$policyId
Request $request

Return Value

NoContent

Exceptions

NotFoundException

at line 662
public RoleAssignmentList assignRoleToUser($userId, Request $request)

Assigns role to user.

Parameters

$userId
Request $request

Return Value

RoleAssignmentList

at line 692
public RoleAssignmentList assignRoleToUserGroup($groupPath, Request $request)

Assigns role to user group.

Parameters

$groupPath
Request $request

Return Value

RoleAssignmentList

at line 726
public RoleAssignmentList unassignRoleFromUser($userId $userId, $roleId $roleId)

Un-assigns role from user.

Parameters

$userId $userId
$roleId $roleId

Return Value

RoleAssignmentList

at line 746
public RoleAssignmentList unassignRoleFromUserGroup($groupPath $groupPath, $roleId $roleId)

Un-assigns role from user group.

Parameters

$groupPath $groupPath
$roleId $roleId

Return Value

RoleAssignmentList

at line 767
public RoleAssignmentList loadRoleAssignmentsForUser($userId $userId)

Loads role assignments for user.

Parameters

$userId $userId

Return Value

RoleAssignmentList

at line 783
public RoleAssignmentList loadRoleAssignmentsForUserGroup($groupPath $groupPath)

Loads role assignments for user group.

Parameters

$groupPath $groupPath

Return Value

RoleAssignmentList

at line 804
public RestUserRoleAssignment loadRoleAssignmentForUser($userId, $roleId, Request $request)

Returns a role assignment to the given user.

Parameters

$userId
$roleId
Request $request

Return Value

RestUserRoleAssignment

Exceptions

NotFoundException

at line 828
public RestUserGroupRoleAssignment loadRoleAssignmentForUserGroup($groupPath, $roleId, Request $request)

Returns a role assignment to the given user group.

Parameters

$groupPath
$roleId
Request $request

Return Value

RestUserGroupRoleAssignment

Exceptions

NotFoundException

at line 849
public PolicyList listPoliciesForUser(Request $request)

Search all policies which are applied to a given user.

Parameters

Request $request

Return Value

PolicyList