AdminAccessUser

Implements \AdminAccessUserInterface

Class AdminAccessUser

A User is a representation of an user with administration rights. Since all users are stored in the customers table of the shop system, the term "customerId" is used to identify such an user. Apart from the ID the user has a collection of roles.

category

System

package

AdminAccess

subpackage

Entities

Methods

AdminAccessUser constructor.

__construct(\AdminAccessUserWriterInterface $writer, \AdminAccessUserDeleterInterface $userDeleter, \IdType $customerId, \AdminAccessRoleCollection $roles) 

Arguments

$writer

\AdminAccessUserWriterInterface

User writer.

$userDeleter

\AdminAccessUserDeleterInterface

User deleter.

$customerId

\IdType

User id.

$roles

\AdminAccessRoleCollection

User roles collection.

Adds a role to this user.

addNewRole(\AdminAccessRoleInterface $role) : \AdminAccessUserInterface

Arguments

$role

\AdminAccessRoleInterface

Role object.

Response

\AdminAccessUserInterface

Returns same instance for chained method calls.

Checks deleting permission for a given group.

checkDeletingPermission(\AdminAccessGroupInterface $group) : boolean

Arguments

$group

\AdminAccessGroupInterface

Group object.

Response

boolean

True if deleting permission is granted, 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 reading permission is granted, 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 writing permission is granted, 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 user from the database.

delete() : \AdminAccessUserInterface

Response

\AdminAccessUserInterface

Returns same instance for chained method calls.

Returns the user id.

getId() : integer

Response

integer

User ID.

Returns the user roles.

getRoles() : \AbstractCollection|\AdminAccessRoleCollection

Response

\AbstractCollection|\AdminAccessRoleCollection

Cloned roles collection.

Removes role from this user.

removeRole(\AdminAccessRoleInterface $role) : \AdminAccessUserInterface
Throws
\RoleNotFoundInCollectionException

Arguments

$role

\AdminAccessRoleInterface

Role object.

Response

\AdminAccessUserInterface

Returns same instance for chained method calls.

Sets the customer ID.

setCustomerId(\IdType $id) : \AdminAccessUserInterface

Arguments

$id

\IdType

Customer ID.

Response

\AdminAccessUserInterface

Returns same instance for chained method calls.

Sets the user roles.

setRoles(\AdminAccessRoleCollection $roles) : \AdminAccessUserInterface

Arguments

$roles

\AdminAccessRoleCollection

Access roles collection.

Response

\AdminAccessUserInterface

Returns same instance for chained method calls.

Stores/Updates an user into/from the database.

update() : \AdminAccessUserInterface

Response

\AdminAccessUserInterface

Returns same instance for chained method calls.

Properties

customerId

customerId : integer
var

Type(s)

integer

roles

roles : \AdminAccessRoleCollection|\AbstractCollection

userWriter

userWriter : \AdminAccessUserWriterInterface

userDeleter

userDeleter : \AdminAccessUserDeleterInterface

readingUnknownGroupGranted

readingUnknownGroupGranted : boolean
var

Type(s)

boolean

writingUnknownGroupGranted

writingUnknownGroupGranted : boolean
var

Type(s)

boolean

deletingUnknownGroupGranted

deletingUnknownGroupGranted : boolean
var

Type(s)

boolean