AdminAccessService

Implements \AdminAccessServiceInterface

Class AdminAccessService

category

System

package

AdminAccess

Methods

AdminAccessService constructor.

__construct(\AdminAccessSettingsInterface $settings, \AdminAccessPermissionManagerInterface $permissionManager, \AdminAccessRoleManagerInterface $roleManager, \AdminAccessUserManagerInterface $userManager, \AdminAccessGroupManagerInterface $groupManager) 

Arguments

$settings

\AdminAccessSettingsInterface

Settings.

$permissionManager

\AdminAccessPermissionManagerInterface

Permission Manager.

$roleManager

\AdminAccessRoleManagerInterface

Role Manager.

$userManager

\AdminAccessUserManagerInterface

User Manager.

$groupManager

\AdminAccessGroupManagerInterface

Group Manager.

Adds a group item to an existing group.

addItemToGroup(\IdType $groupId, \NonEmptyStringType $identifier, \NonEmptyStringType $type) : \AdminAccessGroupInterface
Throws
\GroupNotFoundException

Arguments

$groupId

\IdType

Id of the group.

$identifier

\NonEmptyStringType

Identifier for this item.

$type

\NonEmptyStringType

Type of this item.

Response

\AdminAccessGroupInterface

Group object.

Adds a role to a user by a given role and customer ID.

addRoleToUserByCustomerId(\IdType $roleId, \IdType $customerId) : \AdminAccessServiceInterface

Arguments

$roleId

\IdType

Role ID.

$customerId

\IdType

Customer ID.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Checks the deleting permission for an ajax handler.

checkDeletingPermissionForAjaxHandler(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of an ajax handler to identify an admin access group.

$customerId

\IdType

ID of a customer to check permission for.

Response

boolean

True if customer has a deleting permission for the ajax handler, false otherwise.

Checks the deleting permission for a controller.

checkDeletingPermissionForController(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of a controller to identify an admin access group.

$customerId

\IdType

ID of a customer to check the permission for.

Response

boolean

True if customer has a deleting permission for the controller, false otherwise.

Checks the deleting permission for a page.

checkDeletingPermissionForPage(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of a page to identify an admin access group.

$customerId

\IdType

ID of a customer to check permission for.

Response

boolean

True if customer has a deleting permission for the page, false otherwise.

Checks the reading permission for an ajax handler.

checkReadingPermissionForAjaxHandler(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of an ajax handler to identify an admin access group.

$customerId

\IdType

ID of a customer to check permission for.

Response

boolean

True if customer has a reading permission for the ajax handler, false otherwise.

Checks the reading permission for a controller.

checkReadingPermissionForController(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of a controller to identify an admin access group.

$customerId

\IdType

ID of a customer to check the permission for.

Response

boolean

True if customer has a reading permission for the controller, false otherwise.

Checks the reading permission for a page.

checkReadingPermissionForPage(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of a page to identify an admin access group.

$customerId

\IdType

ID of a customer to check permission for.

Response

boolean

True if customer has a reading permission for the page, false otherwise.

Checks the writing permission for an ajax handler.

checkWritingPermissionForAjaxHandler(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of an ajax handler to identify an admin access group.

$customerId

\IdType

ID of a customer to check permission for.

Response

boolean

True if customer has a writing permission for the ajax handler, false otherwise.

Checks the writing permission for a controller.

checkWritingPermissionForController(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of a controller to identify an admin access group.

$customerId

\IdType

ID of a customer to check the permission for.

Response

boolean

True if customer has a writing permission for the controller, false otherwise.

Checks the writing permission for a page.

checkWritingPermissionForPage(\NonEmptyStringType $identifier, \IdType $customerId) : boolean

Arguments

$identifier

\NonEmptyStringType

The name of a page to identify an admin access group.

$customerId

\IdType

ID of a customer to check permission for.

Response

boolean

True if customer has a writing permission for the page, false otherwise.

Creates a new group.

createNewGroup(\KeyValueCollection $name, \KeyValueCollection $description, \IdType $parentId, \IntType $sortOrder) : \AdminAccessGroupInterface
Throws
\GroupNotFoundException

Arguments

$name

\KeyValueCollection

Collection with the group names. Index of a group name must be his language code.

$description

\KeyValueCollection

Collection with the group descriptions. Index of a group name must be his language code.

$parentId

\IdType

Id of the parent group.

$sortOrder

\IntType

Group sorts order.

Response

\AdminAccessGroupInterface

Returns the create role.

Creates a new role.

createNewRole(\KeyValueCollection $name, \KeyValueCollection $description, \IntType $sortOrder, \BoolType $unknownReadingGranted, \BoolType $unknownWritingGranted, \BoolType $unknownDeletingGranted) : \AdminAccessRoleInterface

Arguments

$name

\KeyValueCollection

Collection with the role names. Index of a role name must be his language code.

$description

\KeyValueCollection

Collection with the role descriptions. Index of a role name must be his language code.

$sortOrder

\IntType

Roles sort order.

$unknownReadingGranted

\BoolType

Value of the reading permission for unknown groups.

$unknownWritingGranted

\BoolType

Value of the writing permission for unknown groups.

$unknownDeletingGranted

\BoolType

Value of the deleting permission for unknown groups.

Response

\AdminAccessRoleInterface

Returns the create role.

Deletes a group by a given group ID.

deleteGroupById(\IdType $id) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$id

\IdType

ID of the group that should be deleted.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Deletes role by a given role ID.

deleteRoleById(\IdType $roleId) : \AdminAccessServiceInterface

Arguments

$roleId

\IdType

ID of the role that should be deleted.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Deletes an admin access user by a given customer ID.

deleteUserByCustomerId(\IdType $customerId) : \AdminAccessServiceInterface

Arguments

$customerId

\IdType

ID of the user that should be deleted.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Returns a collection of all groups.

getAllGroups() : \AdminAccessGroupCollection

Response

\AdminAccessGroupCollection

Group collection.

Returns a collection of all roles.

getAllRoles() : \AdminAccessRoleCollection

Response

\AdminAccessRoleCollection

Role collection with all available roles.

Returns a group by a given ajax handler identifier.

getGroupByAjaxHandler(\NonEmptyStringType $identifier) : \AdminAccessGroupInterface
Throws
\GroupNotFoundException

Arguments

$identifier

\NonEmptyStringType

Ajax handler identifier.

Response

\AdminAccessGroupInterface

Group object.

Returns a group by a given controller identifier.

getGroupByController(\NonEmptyStringType $identifier) : \AdminAccessGroupInterface
Throws
\GroupNotFoundException

Arguments

$identifier

\NonEmptyStringType

Controller identifier.

Response

\AdminAccessGroupInterface

Group object.

Returns a group by a given group id.

getGroupById(\IdType $id) : \AdminAccessGroupInterface
Throws
\GroupNotFoundException

Arguments

$id

\IdType

Group id.

Response

\AdminAccessGroupInterface

Group object.

Returns a group by a given page identifier.

getGroupByPage(\NonEmptyStringType $identifier) : \AdminAccessGroupInterface
Throws
\GroupNotFoundException

Arguments

$identifier

\NonEmptyStringType

Page identifier.

Response

\AdminAccessGroupInterface

Group object.

Returns a collection of permissions of a role by a given group collection.

getPermissionsByGroupCollection(\IdType $roleId, \AdminAccessGroupCollection $groupCollection) : \AdminAccessPermissionCollection

Arguments

$roleId

\IdType

Role ID.

$groupCollection

\AdminAccessGroupCollection

Group collection.

Response

\AdminAccessPermissionCollection

Permission collection object with all role permissions.

Returns a collection of all permissions by a given role ID.

getPermissionsByRoleId(\IdType $roleId) : \AdminAccessPermissionCollection

Arguments

$roleId

\IdType

Role ID.

Response

\AdminAccessPermissionCollection

Permission collection object with all role permissions.

Returns a role by a given role ID.

getRoleById(\IdType $roleId) : \AdminAccessRoleInterface

Arguments

$roleId

\IdType

ID of the requested role.

Response

\AdminAccessRoleInterface

Returns all roles of certain user by a given user ID.

getRolesByCustomerId(\IdType $id) : \AdminAccessRoleCollection

Arguments

$id

\IdType

User ID.

Response

\AdminAccessRoleCollection

Collection of all roles that certain user has.

Grants deleting permission to a role for a given group id.

grantDeletingPermissionToRole(\IdType $groupId, \IdType $roleId) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$groupId

\IdType

Group ID to grant permission for.

$roleId

\IdType

Role ID to grant permission for.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Grants reading permission to a role for a given group id.

grantReadingPermissionToRole(\IdType $groupId, \IdType $roleId) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$groupId

\IdType

Group ID to grant permission for.

$roleId

\IdType

Role ID to grant permission for.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Grants writing permission to a role for a given group id.

grantWritingPermissionToRole(\IdType $groupId, \IdType $roleId) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$groupId

\IdType

Group ID to grant permission for.

$roleId

\IdType

Role ID to grant permission for.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Removes deleting permission from role for a given group id.

removeDeletingPermissionFromRole(\IdType $groupId, \IdType $roleId) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$groupId

\IdType

Group ID to remove permission for.

$roleId

\IdType

Role ID to remove permission from.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Removes a group item from an existing group.

removeItemFromGroup(\IdType $groupId, \NonEmptyStringType $identifier, \NonEmptyStringType $type) : \AdminAccessGroupInterface
Throws
\GroupNotFoundException
\GroupItemNotFoundInCollectionException

Arguments

$groupId

\IdType

Id of the group.

$identifier

\NonEmptyStringType

Identifier for this item.

$type

\NonEmptyStringType

Type of this item.

Response

\AdminAccessGroupInterface

Group object.

Removes reading permission from role for a given group id.

removeReadingPermissionFromRole(\IdType $groupId, \IdType $roleId) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$groupId

\IdType

Group ID to remove permission for.

$roleId

\IdType

Role ID to remove permission from.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Removes a role from a user by given role and customer ID.

removeRoleFromUserByCustomerId(\IdType $roleId, \IdType $customerId) : \AdminAccessServiceInterface

Arguments

$roleId

\IdType

Role ID.

$customerId

\IdType

Customer ID.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Removes writing permission from role for a given group id.

removeWritingPermissionFromRole(\IdType $groupId, \IdType $roleId) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$groupId

\IdType

Group ID to remove permission for.

$roleId

\IdType

Role ID to remove permission from.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Updates a group by a given group ID.

updateGroup(\IdType $id, \KeyValueCollection $newName, \KeyValueCollection $newDescription, \IdType $newParentId, \IntType $newSortOrder) : \AdminAccessServiceInterface
Throws
\GroupNotFoundException

Arguments

$id

\IdType

$newName

\KeyValueCollection

Collection with the group names. Index of a group name must be his language code.

$newDescription

\KeyValueCollection

Collection with the group descriptions. Index of a group name must be his language code.

$newParentId

\IdType

New id of the parent group.

$newSortOrder

\IntType

New group sorts order.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Updates a role by a given role ID.

updateRoleById(\IdType $roleId, \KeyValueCollection $newName, \KeyValueCollection $newDescription, \IntType $newSortOrder, \BoolType $unknownReadingGranted, \BoolType $unknownWritingGranted, \BoolType $unknownDeletingGranted) : \AdminAccessServiceInterface

Arguments

$roleId

\IdType

Role ID to remove permission from.

$newName

\KeyValueCollection

Collection with the new role names. Index of a role name must be his language code.

$newDescription

\KeyValueCollection

Collection with the new role descriptions. Index of a role name must be his language code.

$newSortOrder

\IntType

New roles sort order.

$unknownReadingGranted

\BoolType

Value of the reading permission for unknown groups.

$unknownWritingGranted

\BoolType

Value of the writing permission for unknown groups.

$unknownDeletingGranted

\BoolType

Value of the deleting permission for unknown groups.

Response

\AdminAccessServiceInterface

Returns same instance for chained method calls.

Properties

settings

settings : \AdminAccessSettingsInterface

permissionManager

permissionManager : \AdminAccessPermissionManagerInterface

roleManager

roleManager : \AdminAccessRoleManagerInterface

userManager

userManager : \AdminAccessUserManagerInterface

groupManager

groupManager : \AdminAccessGroupManagerInterface