PHP Class Sulu\Bundle\SecurityBundle\Controller\RoleController

Inheritance: extends Sulu\Component\Rest\RestController, implements FOS\RestBundle\Routing\ClassResourceInterface, implements Sulu\Component\Security\SecuredControllerInterface
ファイルを表示 Open project: sulu/sulu

Protected Properties

Property Type Description
$bundlePrefix
$entityKey
$fieldDescriptors - Holds the field descriptors for the list response TODO: Create a Manager and move the field descriptors to the manager
$fieldsDefault
$fieldsExcluded
$fieldsHidden
$fieldsRelations
$fieldsSortOrder
$fieldsTranslationKeys

Public Methods

Method Description
cgetAction ( Request $request ) : Response returns all roles.
deleteAction ( $id ) : Response Deletes the role with the given id.
getAction ( $id ) : Response Returns the role with the given id.
getFieldsAction ( ) : mixed returns all fields that can be used by list.
getSecurityContext ( )
postAction ( Request $request ) : Response Creates a new role with the given data.
putAction ( Request $request, $id ) : Response Updates the role with the given id and the data given by the request.
putFieldsAction ( ) persists a setting.

Protected Methods

Method Description
addPermission ( Sulu\Component\Security\Authentication\RoleInterface $role, $permissionData ) : boolean Adds a permission to the given role.
convertRole ( Sulu\Component\Security\Authentication\RoleInterface $role ) : array Converts a role object into an array for the rest service.
getFieldDescriptors ( ) TODO: move field descriptors to a manager
processPermissions ( Sulu\Component\Security\Authentication\RoleInterface $role, $permissions ) : boolean Process all permissions from request.

Private Methods

Method Description
checkSecurityTypeData ( $securityTypeData ) : boolean Checks if the data of the security type is correct.
getRoleRepository ( ) : Sulu\Component\Security\Authentication\RoleRepositoryInterface
initFieldDescriptors ( )
setSecurityType ( Sulu\Component\Security\Authentication\RoleInterface $role, $securityTypeData ) Sets the securityType from the given data to the role.
updatePermission ( Permission $permission, $permissionData ) : boolean Updates an already existing permission.

Method Details

addPermission() protected method

Adds a permission to the given role.
protected addPermission ( Sulu\Component\Security\Authentication\RoleInterface $role, $permissionData ) : boolean
$role Sulu\Component\Security\Authentication\RoleInterface
$permissionData
return boolean

cgetAction() public method

returns all roles.
public cgetAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

convertRole() protected method

Converts a role object into an array for the rest service.
protected convertRole ( Sulu\Component\Security\Authentication\RoleInterface $role ) : array
$role Sulu\Component\Security\Authentication\RoleInterface
return array

deleteAction() public method

Deletes the role with the given id.
public deleteAction ( $id ) : Response
$id
return Symfony\Component\HttpFoundation\Response

getAction() public method

Returns the role with the given id.
public getAction ( $id ) : Response
$id
return Symfony\Component\HttpFoundation\Response

getFieldDescriptors() protected method

TODO: move field descriptors to a manager
protected getFieldDescriptors ( )

getFieldsAction() public method

returns all fields that can be used by list.
public getFieldsAction ( ) : mixed
return mixed

getSecurityContext() public method

public getSecurityContext ( )

postAction() public method

Creates a new role with the given data.
public postAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response

processPermissions() protected method

Process all permissions from request.
protected processPermissions ( Sulu\Component\Security\Authentication\RoleInterface $role, $permissions ) : boolean
$role Sulu\Component\Security\Authentication\RoleInterface The contact on which is worked
$permissions
return boolean True if the processing was successful, otherwise false

putAction() public method

Updates the role with the given id and the data given by the request.
public putAction ( Request $request, $id ) : Response
$request Symfony\Component\HttpFoundation\Request
$id
return Symfony\Component\HttpFoundation\Response

putFieldsAction() public method

persists a setting.
public putFieldsAction ( )

Property Details

$bundlePrefix protected_oe property

protected $bundlePrefix

$entityKey protected_oe static_oe property

protected static $entityKey

$fieldDescriptors protected_oe property

- Holds the field descriptors for the list response TODO: Create a Manager and move the field descriptors to the manager
protected $fieldDescriptors

$fieldsDefault protected_oe property

protected $fieldsDefault

$fieldsExcluded protected_oe property

protected $fieldsExcluded

$fieldsHidden protected_oe property

protected $fieldsHidden

$fieldsRelations protected_oe property

protected $fieldsRelations

$fieldsSortOrder protected_oe property

protected $fieldsSortOrder

$fieldsTranslationKeys protected_oe property

protected $fieldsTranslationKeys