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

Inheritance: extends eZ\Publish\Core\REST\Server\Controller
Afficher le fichier Open project: ezsystems/ezpublish-kernel

Protected Properties

Свойство Type Description
$locationService eZ\Publish\API\Repository\LocationService Location service.
$roleService eZ\Publish\API\Repository\RoleService Role service.
$userService eZ\Publish\API\Repository\UserService User service.

Méthodes publiques

Méthode Description
__construct ( eZ\Publish\API\Repository\RoleService $roleService, eZ\Publish\API\Repository\UserService $userService, eZ\Publish\API\Repository\LocationService $locationService ) Construct controller.
addPolicy ( $roleId, Request $request ) : CreatedPolicy Adds a policy to role.
addPolicyByRoleDraft ( $roleId, Request $request ) : CreatedPolicy Adds a policy to a role draft.
assignRoleToUser ( $userId, Request $request ) : RoleAssignmentList Assigns role to user.
assignRoleToUserGroup ( $groupPath, Request $request ) : RoleAssignmentList Assigns role to user group.
createRole ( Request $request ) : CreatedRole Create new role.
createRoleDraft ( $roleId, Request $request ) : CreatedRole Creates a new RoleDraft for an existing Role.
deletePolicies ( $roleId ) : eZ\Publish\Core\REST\Server\Values\NoContent Deletes all policies from a role.
deletePolicy ( $roleId, $policyId, Request $request ) : eZ\Publish\Core\REST\Server\Values\NoContent Delete a policy from role.
deleteRole ( $roleId ) : eZ\Publish\Core\REST\Server\Values\NoContent Delete a role by ID.
deleteRoleDraft ( $roleId ) : eZ\Publish\Core\REST\Server\Values\NoContent Delete a role draft by ID.
listPoliciesForUser ( Request $request ) : PolicyList Search all policies which are applied to a given user.
listRoles ( Request $request ) : RoleList Loads list of roles.
loadPolicies ( $roleId, Request $request ) : PolicyList Loads the policies for the role.
loadPolicy ( $roleId, $policyId, Request $request ) : eZ\Publish\API\Repository\Values\User\Policy Loads a policy.
loadRole ( $roleId ) : eZ\Publish\API\Repository\Values\User\Role Loads role.
loadRoleAssignmentForUser ( $userId, $roleId, Request $request ) : RestUserRoleAssignment Returns a role assignment to the given user.
loadRoleAssignmentForUserGroup ( $groupPath, $roleId, Request $request ) : RestUserGroupRoleAssignment Returns a role assignment to the given user group.
loadRoleAssignmentsForUser ( $userId ) : RoleAssignmentList Loads role assignments for user.
loadRoleAssignmentsForUserGroup ( $groupPath ) : RoleAssignmentList Loads role assignments for user group.
loadRoleDraft ( mixed $roleId ) : eZ\Publish\API\Repository\Values\User\RoleDraft Loads a role draft.
publishRoleDraft ( mixed $roleId ) : PublishedRole Publishes a role draft.
removePolicyByRoleDraft ( $roleId, $policyId, Request $request ) : eZ\Publish\Core\REST\Server\Values\NoContent Remove a policy from a role draft.
unassignRoleFromUser ( $userId, $roleId ) : RoleAssignmentList Un-assigns role from user.
unassignRoleFromUserGroup ( $groupPath, $roleId ) : RoleAssignmentList Un-assigns role from user group.
updatePolicy ( $roleId, $policyId, Request $request ) : eZ\Publish\API\Repository\Values\User\Policy Updates a policy.
updatePolicyByRoleDraft ( $roleId, $policyId, Request $request ) : eZ\Publish\API\Repository\Values\User\Policy Updates a policy.
updateRole ( $roleId, Request $request ) : eZ\Publish\API\Repository\Values\User\Role Updates a role.
updateRoleDraft ( mixed $roleId, Request $request ) : eZ\Publish\API\Repository\Values\User\RoleDraft Updates a role draft.

Méthodes protégées

Méthode Description
mapToUpdateStruct ( eZ\Publish\API\Repository\Values\User\RoleCreateStruct $createStruct ) : eZ\Publish\API\Repository\Values\User\RoleUpdateStruct Maps a RoleCreateStruct to a RoleUpdateStruct.

Private Methods

Méthode Description
getLastAddedPolicy ( $role ) : eZ\Publish\API\Repository\Values\User\Policy Get the last added policy for $role.

Method Details

__construct() public méthode

Construct controller.
public __construct ( eZ\Publish\API\Repository\RoleService $roleService, eZ\Publish\API\Repository\UserService $userService, eZ\Publish\API\Repository\LocationService $locationService )
$roleService eZ\Publish\API\Repository\RoleService
$userService eZ\Publish\API\Repository\UserService
$locationService eZ\Publish\API\Repository\LocationService

addPolicy() public méthode

Adds a policy to role.
public addPolicy ( $roleId, Request $request ) : CreatedPolicy
$roleId int ID of a role or a role draft
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\CreatedPolicy

addPolicyByRoleDraft() public méthode

Adds a policy to a role draft.
Deprecation: since 6.3, use {@see \addPolicy}
Since: 6.2
public addPolicyByRoleDraft ( $roleId, Request $request ) : CreatedPolicy
$roleId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\CreatedPolicy

assignRoleToUser() public méthode

Assigns role to user.
public assignRoleToUser ( $userId, Request $request ) : RoleAssignmentList
$userId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\RoleAssignmentList

assignRoleToUserGroup() public méthode

Assigns role to user group.
public assignRoleToUserGroup ( $groupPath, Request $request ) : RoleAssignmentList
$groupPath
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\RoleAssignmentList

createRole() public méthode

Defaults to publishing the role, but you can create a draft instead by setting the POST parameter publish=false
public createRole ( Request $request ) : CreatedRole
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\CreatedRole

createRoleDraft() public méthode

Creates a new RoleDraft for an existing Role.
Since: 6.2
public createRoleDraft ( $roleId, Request $request ) : CreatedRole
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\CreatedRole

deletePolicies() public méthode

Deletes all policies from a role.
public deletePolicies ( $roleId ) : eZ\Publish\Core\REST\Server\Values\NoContent
$roleId
Résultat eZ\Publish\Core\REST\Server\Values\NoContent

deletePolicy() public méthode

Delete a policy from role.
public deletePolicy ( $roleId, $policyId, Request $request ) : eZ\Publish\Core\REST\Server\Values\NoContent
$roleId int ID of a role or a role draft
$policyId int ID of a policy
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\NoContent

deleteRole() public méthode

Delete a role by ID.
public deleteRole ( $roleId ) : eZ\Publish\Core\REST\Server\Values\NoContent
$roleId
Résultat eZ\Publish\Core\REST\Server\Values\NoContent

deleteRoleDraft() public méthode

Delete a role draft by ID.
Since: 6.2
public deleteRoleDraft ( $roleId ) : eZ\Publish\Core\REST\Server\Values\NoContent
$roleId
Résultat eZ\Publish\Core\REST\Server\Values\NoContent

listPoliciesForUser() public méthode

Search all policies which are applied to a given user.
public listPoliciesForUser ( Request $request ) : PolicyList
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\PolicyList

listRoles() public méthode

Loads list of roles.
public listRoles ( Request $request ) : RoleList
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\RoleList

loadPolicies() public méthode

Loads the policies for the role.
public loadPolicies ( $roleId, Request $request ) : PolicyList
$roleId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\PolicyList

loadPolicy() public méthode

Loads a policy.
public loadPolicy ( $roleId, $policyId, Request $request ) : eZ\Publish\API\Repository\Values\User\Policy
$roleId
$policyId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\API\Repository\Values\User\Policy

loadRole() public méthode

Loads role.
public loadRole ( $roleId ) : eZ\Publish\API\Repository\Values\User\Role
$roleId
Résultat eZ\Publish\API\Repository\Values\User\Role

loadRoleAssignmentForUser() public méthode

Returns a role assignment to the given user.
public loadRoleAssignmentForUser ( $userId, $roleId, Request $request ) : RestUserRoleAssignment
$userId
$roleId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\RestUserRoleAssignment

loadRoleAssignmentForUserGroup() public méthode

Returns a role assignment to the given user group.
public loadRoleAssignmentForUserGroup ( $groupPath, $roleId, Request $request ) : RestUserGroupRoleAssignment
$groupPath
$roleId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\RestUserGroupRoleAssignment

loadRoleAssignmentsForUser() public méthode

Loads role assignments for user.
public loadRoleAssignmentsForUser ( $userId ) : RoleAssignmentList
$userId
Résultat eZ\Publish\Core\REST\Server\Values\RoleAssignmentList

loadRoleAssignmentsForUserGroup() public méthode

Loads role assignments for user group.
public loadRoleAssignmentsForUserGroup ( $groupPath ) : RoleAssignmentList
$groupPath
Résultat eZ\Publish\Core\REST\Server\Values\RoleAssignmentList

loadRoleDraft() public méthode

Loads a role draft.
public loadRoleDraft ( mixed $roleId ) : eZ\Publish\API\Repository\Values\User\RoleDraft
$roleId mixed Original role ID, or ID of the role draft itself
Résultat eZ\Publish\API\Repository\Values\User\RoleDraft

mapToUpdateStruct() protected méthode

Needed since both structs are encoded into the same media type on input.
protected mapToUpdateStruct ( eZ\Publish\API\Repository\Values\User\RoleCreateStruct $createStruct ) : eZ\Publish\API\Repository\Values\User\RoleUpdateStruct
$createStruct eZ\Publish\API\Repository\Values\User\RoleCreateStruct
Résultat eZ\Publish\API\Repository\Values\User\RoleUpdateStruct

publishRoleDraft() public méthode

Publishes a role draft.
public publishRoleDraft ( mixed $roleId ) : PublishedRole
$roleId mixed Original role ID, or ID of the role draft itself
Résultat eZ\Publish\Core\REST\Server\Values\PublishedRole

removePolicyByRoleDraft() public méthode

Remove a policy from a role draft.
Deprecation: since 6.3, use {@see \deletePolicy}
Since: 6.2
public removePolicyByRoleDraft ( $roleId, $policyId, Request $request ) : eZ\Publish\Core\REST\Server\Values\NoContent
$roleId
$policyId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\Core\REST\Server\Values\NoContent

unassignRoleFromUser() public méthode

Un-assigns role from user.
public unassignRoleFromUser ( $userId, $roleId ) : RoleAssignmentList
$userId
$roleId
Résultat eZ\Publish\Core\REST\Server\Values\RoleAssignmentList

unassignRoleFromUserGroup() public méthode

Un-assigns role from user group.
public unassignRoleFromUserGroup ( $groupPath, $roleId ) : RoleAssignmentList
$groupPath
$roleId
Résultat eZ\Publish\Core\REST\Server\Values\RoleAssignmentList

updatePolicy() public méthode

Updates a policy.
public updatePolicy ( $roleId, $policyId, Request $request ) : eZ\Publish\API\Repository\Values\User\Policy
$roleId int ID of a role or a role draft
$policyId int ID of a policy
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\API\Repository\Values\User\Policy

updatePolicyByRoleDraft() public méthode

Updates a policy.
Deprecation: since 6.3, use {@see \updatePolicy}
Since: 6.2
public updatePolicyByRoleDraft ( $roleId, $policyId, Request $request ) : eZ\Publish\API\Repository\Values\User\Policy
$roleId
$policyId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\API\Repository\Values\User\Policy

updateRole() public méthode

Updates a role.
public updateRole ( $roleId, Request $request ) : eZ\Publish\API\Repository\Values\User\Role
$roleId
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\API\Repository\Values\User\Role

updateRoleDraft() public méthode

Updates a role draft.
public updateRoleDraft ( mixed $roleId, Request $request ) : eZ\Publish\API\Repository\Values\User\RoleDraft
$roleId mixed Original role ID, or ID of the role draft itself
$request Symfony\Component\HttpFoundation\Request
Résultat eZ\Publish\API\Repository\Values\User\RoleDraft

Property Details

$locationService protected_oe property

Location service.
protected LocationService,eZ\Publish\API\Repository $locationService
Résultat eZ\Publish\API\Repository\LocationService

$roleService protected_oe property

Role service.
protected RoleService,eZ\Publish\API\Repository $roleService
Résultat eZ\Publish\API\Repository\RoleService

$userService protected_oe property

User service.
protected UserService,eZ\Publish\API\Repository $userService
Résultat eZ\Publish\API\Repository\UserService