AdminAccessRole

Implements \AdminAccessRoleInterface

Class AdminAccessRole

A role represents a collection of administration permissions that can be assigned to an user. The role has also a set of descriptive attributes like a name and a description so the user can understand, what the roles purpose is.

category

System

package

AdminAccess

subpackage

Entities

Methods

AdminAccessRole constructor.

__construct(\AdminAccessRoleDeleterInterface $deleter, \AdminAccessRoleWriterInterface $writer, \AdminAccessPermissionReaderInterface $permissionReader) 

Arguments

$deleter

\AdminAccessRoleDeleterInterface

Role deleter.

$writer

\AdminAccessRoleWriterInterface

Role writer.

$permissionReader

\AdminAccessPermissionReaderInterface

Permission reader.

Checks deleting permission for a given group.

checkDeletingPermission(\AdminAccessGroupInterface $group) : boolean

Arguments

$group

\AdminAccessGroupInterface

Group object.

Response

boolean

True if role has deleting permission, false otherwise.

Checks deleting permission for an unknown group.

checkDeletingPermissionForUnknownGroup() : boolean

Response

boolean

True if deleting permission for an unknown group is granted, false otherwise.

Checks reading permission for a given group.

checkReadingPermission(\AdminAccessGroupInterface $group) : boolean

Arguments

$group

\AdminAccessGroupInterface

Group object.

Response

boolean

True if role has reading permission, false otherwise.

Checks reading permission for an unknown group.

checkReadingPermissionForUnknownGroup() : boolean

Response

boolean

True if reading permission for an unknown group is granted, false otherwise.

Checks writing permission for a given group.

checkWritingPermission(\AdminAccessGroupInterface $group) : boolean

Arguments

$group

\AdminAccessGroupInterface

Group object.

Response

boolean

True if role has writing permission, false otherwise.

Checks writing permission for an unknown group.

checkWritingPermissionForUnknownGroup() : boolean

Response

boolean

True if writing permission for an unknown group is granted, false otherwise.

Deletes an access role.

delete() : \AdminAccessRoleInterface
Throws
\ProtectedRoleException

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Returns the role descriptions as a collection.

getDescription() : \KeyValueCollection

Response

\KeyValueCollection

Role description in all available languages.

Returns the role id.

getId() : integer

Response

integer

Role ID.

Returns the role names as a collection.

getName() : \KeyValueCollection

Response

\KeyValueCollection

Role name in all available languages.

Returns the a permission for this role by a given group.

getPermissionByGroup( $group) : \AdminAccessPermissionPresentationInterface|\AdminAccessPermissionPersistenceInterface|null

Arguments

$group

AdminAccessGroupInterface Admin access group.

Response

\AdminAccessPermissionPresentationInterface|\AdminAccessPermissionPersistenceInterface|null

Returns permission found or null if permission not found.

Returns the a permission for this role by a given group collection.

getPermissionsByGroupCollection( $groupCollection) : \AdminAccessPermissionCollection

Arguments

$groupCollection

AdminAccessGroupCollection Collections of groups to find.

Response

\AdminAccessPermissionCollection

Returns permissions collection.

Returns the protected value.

getProtected() : boolean

Response

boolean

Returns the role sort order.

getSortOrder() : integer

Response

integer

Sort order.

Sets the deleting permission value for an unknown group.

setDeletingUnknownGroupGranted(\BoolType $permissionGranted) : \AdminAccessRoleInterface

Arguments

$permissionGranted

\BoolType

Value of the deleting permission for unknown groups.

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Sets the role description.

setDescription(\KeyValueCollection $description) : \AdminAccessRoleInterface

Arguments

$description

\KeyValueCollection

Role description.

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Sets the role ID.

setId(\IdType $id) : \AdminAccessRoleInterface

Arguments

$id

\IdType

Role ID.

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Sets the role names.

setName(\KeyValueCollection $name) : \AdminAccessRoleInterface

Arguments

$name

\KeyValueCollection

Role name.

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Sets the protected value.

setProtected(\BoolType $value) : \AdminAccessRoleInterface

Arguments

$value

\BoolType

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Sets the reading permission value for an unknown group.

setReadingUnknownGroupGranted(\BoolType $permissionGranted) : \AdminAccessRoleInterface

Arguments

$permissionGranted

\BoolType

Value of the reading permission for unknown groups.

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Sets the role sort order.

setSortOrder(\IntType $sortOrder) : \AdminAccessRoleInterface

Arguments

$sortOrder

\IntType

Role sort order.

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Sets the writing permission value for an unknown group.

setWritingUnknownGroupGranted(\BoolType $permissionGranted) : \AdminAccessRoleInterface

Arguments

$permissionGranted

\BoolType

Value of the writing permission for unknown groups.

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Stores this role into the database.

store() : \AdminAccessRoleInterface
Throws
\ProtectedRoleException

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Updates this role in the database.

update() : \AdminAccessRoleInterface
Throws
\ProtectedRoleException

Response

\AdminAccessRoleInterface

Returns same instance for chained method calls.

Properties

id

id : integer
var

Type(s)

integer

name

name : \KeyValueCollection
var

Type(s)

\KeyValueCollection

description

description : \KeyValueCollection
var

Type(s)

\KeyValueCollection

sortOrder

sortOrder : integer
var

Type(s)

integer

deleter

deleter : \AdminAccessRoleDeleterInterface

writer

writer : \AdminAccessRoleWriterInterface

permissionReader

permissionReader : \AdminAccessPermissionReaderInterface

deletingUnknownGroupGranted

deletingUnknownGroupGranted : boolean
var

Type(s)

boolean

readingUnknownGroupGranted

readingUnknownGroupGranted : boolean
var

Type(s)

boolean

writingUnknownGroupGranted

writingUnknownGroupGranted : boolean
var

Type(s)

boolean

protected

protected : boolean
var

Type(s)

boolean