Properties

$data

$data : 

TODO

Type

$name

$name : 

TODO

Type

$_cacheVersion

$_cacheVersion : integer

Incrementing version number if cached classes change.

Type

integer

Methods

__construct()

__construct(string  $name, integer  $cacheVersion = null, string  $type = 'matrix', array  $params = null) 

Constructor.

Parameters

string $name

The name of the perm.

integer $cacheVersion

The revision number of the class.

string $type

The permission type.

array $params

A hash with any parameters that the permission type needs.

setCacheVersion()

setCacheVersion(integer  $cacheVersion) 

Sets the revision number of the class.

Parameters

integer $cacheVersion

The revision number of the class.

get()

get(string  $attribute) : mixed

Gets one of the attributes of the object, or null if it isn't defined.

Parameters

string $attribute

The attribute to get.

Returns

mixed —

The value of the attribute, or null.

getName()

getName() : string

Get permission name.

Returns

string —

Permission name.

setName()

setName(string  $name) 

Set permission name

Parameters

string $name

Permission name.

getData()

getData() : array

Get permission details.

Returns

array —

Permission details.

setData()

setData(string  $data) 

Set permission details.

Parameters

string $data

Permission details.

updatePermissions()

updatePermissions(array  $perms) 

Updates the permissions based on data passed in the array.

Parameters

array $perms

An array containing the permissions which are to be updated.

setPerm()

setPerm(  $permId,   $permission,   $update = true) 

TODO

Parameters

$permId
$permission
$update

unsetPerm()

unsetPerm(  $permId,   $permission,   $update = true) 

TODO

Parameters

$permId
$permission
$update

addUserPermission()

addUserPermission(  $user, integer  $permission, boolean  $update = true) 

Grants a user additional permissions to this object.

Parameters

$user
integer $permission

The permission (DELETE, etc.) to add.

boolean $update

Whether to automatically update the backend.

addGuestPermission()

addGuestPermission(integer  $permission, boolean  $update = true) 

Grants guests additional permissions to this object.

Parameters

integer $permission

The permission (DELETE, etc.) to add.

boolean $update

Whether to automatically update the backend.

addCreatorPermission()

addCreatorPermission(integer  $permission, boolean  $update = true) 

Grants creators additional permissions to this object.

Parameters

integer $permission

The permission (DELETE, etc.) to add.

boolean $update

Whether to automatically update the backend.

addDefaultPermission()

addDefaultPermission(integer  $permission, boolean  $update = true) 

Grants additional default permissions to this object.

Parameters

integer $permission

The permission (DELETE, etc.) to add.

boolean $update

Whether to automatically update the backend.

addGroupPermission()

addGroupPermission(integer  $groupId, integer  $permission, boolean  $update = true) 

Grants a group additional permissions to this object.

Parameters

integer $groupId

The id of the group to grant additional permissions to.

integer $permission

The permission (DELETE, etc.) to add.

boolean $update

Whether to automatically update the backend.

removeUserPermission()

removeUserPermission(string  $user = null, integer  $permission = null, boolean  $update = true) 

Removes a permission that a user currently has on this object.

Parameters

string $user

The user to remove the permission from. Defaults to all users.

integer $permission

The permission (DELETE, etc.) to remove. Defaults to all permissions.

boolean $update

Whether to automatically update the backend.

removeGuestPermission()

removeGuestPermission(integer  $permission = null, boolean  $update = true) 

Removes a permission that guests currently have on this object.

Parameters

integer $permission

The permission (DELETE, etc.) to remove. Defaults to all permissions.

boolean $update

Whether to automatically update the backend.

removeCreatorPermission()

removeCreatorPermission(integer  $permission = null, boolean  $update = true) 

Removes a permission that creators currently have on this object.

Parameters

integer $permission

The permission (DELETE, etc.) to remove. Defaults to all permissions.

boolean $update

Whether to automatically update the backend.

removeDefaultPermission()

removeDefaultPermission(integer  $permission = null, boolean  $update = true) 

Removes a default permission on this object.

Parameters

integer $permission

The permission (DELETE, etc.) to remove. Defaults to all permissions.

boolean $update

Whether to automatically update the backend.

removeGroupPermission()

removeGroupPermission(integer  $groupId = null, integer  $permission = null, boolean  $update = true) 

Removes a permission that a group currently has on this object.

Parameters

integer $groupId

The id of the group to remove the permission from. Defaults to all groups.

integer $permission

The permission (DELETE, etc.) to remove. Defaults to all permissions.

boolean $update

Whether to automatically update the backend.

getUserPermissions()

getUserPermissions(integer  $perm = null) : array

Returns an array of all user permissions on this object.

Parameters

integer $perm

List only users with this permission level. Defaults to all users.

Returns

array —

All user permissions for this object, indexed by user.

getGuestPermissions()

getGuestPermissions() : integer

Returns the guest permissions on this object.

Returns

integer —

The guest permissions on this object.

getCreatorPermissions()

getCreatorPermissions() : integer

Returns the creator permissions on this object.

Returns

integer —

The creator permissions on this object.

getDefaultPermissions()

getDefaultPermissions() : integer

Returns the default permissions on this object.

Returns

integer —

The default permissions on this object.

getGroupPermissions()

getGroupPermissions(integer  $perm = null) : array

Returns an array of all group permissions on this object.

Parameters

integer $perm

List only users with this permission level. Defaults to all users.

Returns

array —

All group permissions for this object, indexed by group.

save()

save() 

TODO