class RoleManager implements BasicEntityManagerInterface

Class RoleManager is injected as alligator.role.manager service. RoleManager handles the logic for entity.

Constants

ROLE_ROUTE_PERMISSIONS_REDIS_KEY

Caching key

Properties

protected RoleRepository $repository
protected RoleEventContainer $eventContainer

Methods

__construct(RoleRepository $repository, RoleEventContainer $eventContainer)

No description

string
getRoleTree(array $options = array())

Get tree of roles

mixed
getAllTreeRolesForRoleAddTree()

Get formatted tree

mixed
saveRole(Role $newRole)

Persist Role

bool
deleteRole(int $roleId)

Delete single role by id

editRole(mixed $newRole, mixed $positionChanged, Role $previous)

Merge role

array
getAllGroups()

Get all groups

array
getRolesFromArray(array $roles)

Get multiple roles from database

array
getAllRolesIdAndName()

Get array of all roles

bool
editRoutePermissions(array $roles)

Edit permissions for roles

array
getAllRoutes()

Get lis of all available routes

Client
getCache()

Get cache

array
getRoutePermissionsFromCache()

Get cached route param values. If there are no routes cached cache them

array
saveRoutePermissionsToCache(array $roles)

Set route permissions to cache

string
generateAllRoutesHTML()

Convert array of routes to html content

RoleEvent|Event
dispatchReCacheRolePermission()

Dispatch event for caching

bool
checkRolePermissions(mixed $permission, mixed $role)

Check if specified role has permission

mixed
dispatchAdditionalProductPermission(mixed $permission, mixed $param)

Dispatch event for special product permissions Example: event to check permissions for product flags on motobike

User|null
getCurrentUser()

No description

array
getDataForJqGrid()

No description

bool
setDefaultRoutePermissions()

No description

Details

at line 45
__construct(RoleRepository $repository, RoleEventContainer $eventContainer)

Parameters

RoleRepository $repository
RoleEventContainer $eventContainer

at line 57
string getRoleTree(array $options = array())

Get tree of roles

Parameters

array $options

Return Value

string

at line 66
mixed getAllTreeRolesForRoleAddTree()

Get formatted tree

Return Value

mixed

at line 91
mixed saveRole(Role $newRole)

Persist Role

Parameters

Role $newRole

Return Value

mixed

at line 111
bool deleteRole(int $roleId)

Delete single role by id

Parameters

int $roleId

Return Value

bool

at line 126
Role editRole(mixed $newRole, mixed $positionChanged, Role $previous)

Merge role

Parameters

mixed $newRole
mixed $positionChanged
Role $previous

Return Value

Role

at line 147
array getAllGroups()

Get all groups

Return Value

array

at line 158
array getRolesFromArray(array $roles)

Get multiple roles from database

Parameters

array $roles

Return Value

array

at line 167
array getAllRolesIdAndName()

Get array of all roles

Return Value

array

at line 178
bool editRoutePermissions(array $roles)

Edit permissions for roles

Parameters

array $roles

Return Value

bool

at line 203
array getAllRoutes()

Get lis of all available routes

Return Value

array

at line 215
Client getCache()

Get cache

Return Value

Client

at line 224
array getRoutePermissionsFromCache()

Get cached route param values. If there are no routes cached cache them

Return Value

array

at line 240
array saveRoutePermissionsToCache(array $roles)

Set route permissions to cache

Parameters

array $roles

Return Value

array

at line 270
string generateAllRoutesHTML()

Convert array of routes to html content

Return Value

string

Exceptions

Error

at line 279
RoleEvent|Event dispatchReCacheRolePermission()

Dispatch event for caching

Return Value

RoleEvent|Event

at line 291
bool checkRolePermissions(mixed $permission, mixed $role)

Check if specified role has permission

Parameters

mixed $permission
mixed $role

Return Value

bool

at line 305
mixed dispatchAdditionalProductPermission(mixed $permission, mixed $param)

Dispatch event for special product permissions Example: event to check permissions for product flags on motobike

Parameters

mixed $permission
mixed $param

Return Value

mixed

at line 313
User|null getCurrentUser()

Return Value

User|null

at line 321
array getDataForJqGrid()

Return Value

array

at line 342
bool setDefaultRoutePermissions()

Return Value

bool