eZPublishCommunityProject  2013.9
eZ\Publish\Core\REST\Server\Controller\Role Class Reference

Role controller. More...

+ Inheritance diagram for eZ\Publish\Core\REST\Server\Controller\Role:
+ Collaboration diagram for eZ\Publish\Core\REST\Server\Controller\Role:

Public Member Functions

 __construct (RoleService $roleService, UserService $userService, LocationService $locationService)
 Construct controller. More...
 
 addPolicy ($roleId)
 Adds a policy to role. More...
 
 assignRoleToUser ($userId)
 Assigns role to user. More...
 
 assignRoleToUserGroup ($groupPath)
 Assigns role to user group. More...
 
 createRole ()
 Create new role. More...
 
 deletePolicies ($roleId)
 Deletes all policies from a role. More...
 
 deletePolicy ($roleId, $policyId)
 Delete a policy from role. More...
 
 deleteRole ($roleId)
 Delete a role by ID. More...
 
 listPoliciesForUser ()
 Search all policies which are applied to a given user. More...
 
 listRoles ()
 Loads list of roles. More...
 
 loadPolicies ($roleId)
 Loads the policies for the role. More...
 
 loadPolicy ($roleId, $policyId)
 Loads a policy. More...
 
 loadRole ($roleId)
 Loads role. More...
 
 loadRoleAssignmentForUser ($userId, $roleId)
 Returns a role assignment to the given user. More...
 
 loadRoleAssignmentForUserGroup ($groupPath, $roleId)
 Returns a role assignment to the given user group. More...
 
 loadRoleAssignmentsForUser ($userId)
 Loads role assignments for user. More...
 
 loadRoleAssignmentsForUserGroup ($groupPath)
 Loads role assignments for user group. More...
 
 unassignRoleFromUser ($userId, $roleId)
 Un-assigns role from user. More...
 
 unassignRoleFromUserGroup ($groupPath, $roleId)
 Un-assigns role from user group. More...
 
 updatePolicy ($roleId, $policyId)
 Updates a policy. More...
 
 updateRole ($roleId)
 Updates a role. More...
 
- Public Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
 setContainer (Container $container)
 
 setInputDispatcher (InputDispatcher $inputDispatcher)
 
 setRepository (Repository $repository)
 
 setRequest (Request $request=null)
 
 setRequestParser (RequestParser $requestParser)
 
 setRouter (RouterInterface $router)
 

Protected Member Functions

 mapToUpdateStruct (RoleCreateStruct $createStruct)
 Maps a RoleCreateStruct to a RoleUpdateStruct. More...
 
- Protected Member Functions inherited from eZ\Publish\Core\REST\Server\Controller
 getMediaType ()
 Extracts the requested media type from $request. More...
 

Protected Attributes

 $locationService
 
 $roleService
 
 $userService
 
- Protected Attributes inherited from eZ\Publish\Core\REST\Server\Controller
 $container
 
 $inputDispatcher
 
 $repository
 
 $request
 
 $requestParser
 
 $router
 

Detailed Description

Role controller.

Constructor & Destructor Documentation

eZ\Publish\Core\REST\Server\Controller\Role::__construct ( RoleService  $roleService,
UserService  $userService,
LocationService  $locationService 
)

Construct controller.

Parameters
\eZ\Publish\API\Repository\RoleService$roleService
\eZ\Publish\API\Repository\UserService$userService
\eZ\Publish\API\Repository\LocationService$locationService

Member Function Documentation

eZ\Publish\Core\REST\Server\Controller\Role::addPolicy (   $roleId)

Adds a policy to role.

Parameters
$roleId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::assignRoleToUser (   $userId)

Assigns role to user.

Parameters
$userId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::assignRoleToUserGroup (   $groupPath)

Assigns role to user group.

Parameters
$groupPath
Returns
eZ\Publish\Core\REST\Server\Controller\Role::createRole ( )

Create new role.

Returns
eZ\Publish\Core\REST\Server\Controller\Role::deletePolicies (   $roleId)

Deletes all policies from a role.

Parameters
$roleId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::deletePolicy (   $roleId,
  $policyId 
)

Delete a policy from role.

Parameters
$roleId
$policyId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\Role::deleteRole (   $roleId)

Delete a role by ID.

Parameters
$roleId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::listPoliciesForUser ( )

Search all policies which are applied to a given user.

Returns
eZ\Publish\Core\REST\Server\Controller\Role::listRoles ( )

Loads list of roles.

Returns
eZ\Publish\Core\REST\Server\Controller\Role::loadPolicies (   $roleId)

Loads the policies for the role.

Parameters
$roleId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::loadPolicy (   $roleId,
  $policyId 
)

Loads a policy.

Parameters
$roleId
$policyId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\Role::loadRole (   $roleId)

Loads role.

Parameters
$roleId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::loadRoleAssignmentForUser (   $userId,
  $roleId 
)

Returns a role assignment to the given user.

Parameters
$userId
$roleId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\Role::loadRoleAssignmentForUserGroup (   $groupPath,
  $roleId 
)

Returns a role assignment to the given user group.

Parameters
$groupPath
$roleId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\Role::loadRoleAssignmentsForUser (   $userId)

Loads role assignments for user.

Parameters
$userId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::loadRoleAssignmentsForUserGroup (   $groupPath)

Loads role assignments for user group.

Parameters
$groupPath
Returns
eZ\Publish\Core\REST\Server\Controller\Role::mapToUpdateStruct ( RoleCreateStruct  $createStruct)
protected

Maps a RoleCreateStruct to a RoleUpdateStruct.

Needed since both structs are encoded into the same media type on input.

Parameters
\eZ\Publish\API\Repository\Values\User\RoleCreateStruct$createStruct
Returns

Referenced by eZ\Publish\Core\REST\Server\Controller\Role\updateRole().

eZ\Publish\Core\REST\Server\Controller\Role::unassignRoleFromUser (   $userId,
  $roleId 
)

Un-assigns role from user.

Parameters
$userId
$roleId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::unassignRoleFromUserGroup (   $groupPath,
  $roleId 
)

Un-assigns role from user group.

Parameters
$groupPath
$roleId
Returns
eZ\Publish\Core\REST\Server\Controller\Role::updatePolicy (   $roleId,
  $policyId 
)

Updates a policy.

Parameters
$roleId
$policyId
Exceptions
\eZ\Publish\Core\REST\Common\Exceptions\NotFoundException
Returns
eZ\Publish\Core\REST\Server\Controller\Role::updateRole (   $roleId)

Updates a role.

Parameters
$roleId
Returns

Member Data Documentation

eZ\Publish\Core\REST\Server\Controller\Role::$locationService
protected
eZ\Publish\Core\REST\Server\Controller\Role::$roleService
protected
eZ\Publish\Core\REST\Server\Controller\Role::$userService
protected

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