Documentation

Horde_Perms_Permission
in package

Instance of a single permissioning object.

Copyright 2009-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Tags
author

Chuck Hagenbuch chuck@horde.org

author

Jan Schneider jan@horde.org

category

Horde

Table of Contents

$data  : mixed
TODO
$name  : mixed
TODO
$_cacheVersion  : int
Incrementing version number if cached classes change.
__construct()  : mixed
Constructor.
addCreatorPermission()  : mixed
Grants creators additional permissions to this object.
addDefaultPermission()  : mixed
Grants additional default permissions to this object.
addGroupPermission()  : mixed
Grants a group additional permissions to this object.
addGuestPermission()  : mixed
Grants guests additional permissions to this object.
addUserPermission()  : mixed
Grants a user additional permissions to this object.
get()  : mixed
Gets one of the attributes of the object, or null if it isn't defined.
getCreatorPermissions()  : int
Returns the creator permissions on this object.
getData()  : array<string|int, mixed>
Get permission details.
getDefaultPermissions()  : int
Returns the default permissions on this object.
getGroupPermissions()  : array<string|int, mixed>
Returns an array of all group permissions on this object.
getGuestPermissions()  : int
Returns the guest permissions on this object.
getName()  : string
Get permission name.
getUserPermissions()  : array<string|int, mixed>
Returns an array of all user permissions on this object.
removeCreatorPermission()  : mixed
Removes a permission that creators currently have on this object.
removeDefaultPermission()  : mixed
Removes a default permission on this object.
removeGroupPermission()  : mixed
Removes a permission that a group currently has on this object.
removeGuestPermission()  : mixed
Removes a permission that guests currently have on this object.
removeUserPermission()  : mixed
Removes a permission that a user currently has on this object.
save()  : mixed
TODO
setCacheVersion()  : mixed
Sets the revision number of the class.
setData()  : mixed
Set permission details.
setName()  : mixed
Set permission name
setPerm()  : mixed
TODO
unsetPerm()  : mixed
TODO
updatePermissions()  : mixed
Updates the permissions based on data passed in the array.

Properties

$_cacheVersion

Incrementing version number if cached classes change.

protected int $_cacheVersion

Methods

__construct()

Constructor.

public __construct(string $name[, int $cacheVersion = null ][, string $type = 'matrix' ][, array<string|int, mixed> $params = null ]) : mixed
Parameters
$name : string

The name of the perm.

$cacheVersion : int = null

The revision number of the class.

$type : string = 'matrix'

The permission type.

$params : array<string|int, mixed> = null

A hash with any parameters that the permission type needs.

Return values
mixed

addCreatorPermission()

Grants creators additional permissions to this object.

public addCreatorPermission(int $permission[, bool $update = true ]) : mixed
Parameters
$permission : int

The permission (DELETE, etc.) to add.

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

addDefaultPermission()

Grants additional default permissions to this object.

public addDefaultPermission(int $permission[, bool $update = true ]) : mixed
Parameters
$permission : int

The permission (DELETE, etc.) to add.

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

addGroupPermission()

Grants a group additional permissions to this object.

public addGroupPermission(int $groupId, int $permission[, bool $update = true ]) : mixed
Parameters
$groupId : int

The id of the group to grant additional permissions to.

$permission : int

The permission (DELETE, etc.) to add.

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

addGuestPermission()

Grants guests additional permissions to this object.

public addGuestPermission(int $permission[, bool $update = true ]) : mixed
Parameters
$permission : int

The permission (DELETE, etc.) to add.

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

addUserPermission()

Grants a user additional permissions to this object.

public addUserPermission(mixed $user, int $permission[, bool $update = true ]) : mixed
Parameters
$user : mixed
$permission : int

The permission (DELETE, etc.) to add.

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

get()

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

public get(string $attribute) : mixed
Parameters
$attribute : string

The attribute to get.

Return values
mixed

The value of the attribute, or null.

getCreatorPermissions()

Returns the creator permissions on this object.

public getCreatorPermissions() : int
Return values
int

The creator permissions on this object.

getData()

Get permission details.

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

Permission details.

getDefaultPermissions()

Returns the default permissions on this object.

public getDefaultPermissions() : int
Return values
int

The default permissions on this object.

getGroupPermissions()

Returns an array of all group permissions on this object.

public getGroupPermissions([int $perm = null ]) : array<string|int, mixed>
Parameters
$perm : int = null

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

Return values
array<string|int, mixed>

All group permissions for this object, indexed by group.

getGuestPermissions()

Returns the guest permissions on this object.

public getGuestPermissions() : int
Return values
int

The guest permissions on this object.

getName()

Get permission name.

public getName() : string
Return values
string

Permission name.

getUserPermissions()

Returns an array of all user permissions on this object.

public getUserPermissions([int $perm = null ]) : array<string|int, mixed>
Parameters
$perm : int = null

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

Return values
array<string|int, mixed>

All user permissions for this object, indexed by user.

removeCreatorPermission()

Removes a permission that creators currently have on this object.

public removeCreatorPermission([int $permission = null ][, bool $update = true ]) : mixed
Parameters
$permission : int = null

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

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

removeDefaultPermission()

Removes a default permission on this object.

public removeDefaultPermission([int $permission = null ][, bool $update = true ]) : mixed
Parameters
$permission : int = null

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

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

removeGroupPermission()

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

public removeGroupPermission([int $groupId = null ][, int $permission = null ][, bool $update = true ]) : mixed
Parameters
$groupId : int = null

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

$permission : int = null

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

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

removeGuestPermission()

Removes a permission that guests currently have on this object.

public removeGuestPermission([int $permission = null ][, bool $update = true ]) : mixed
Parameters
$permission : int = null

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

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

removeUserPermission()

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

public removeUserPermission([string $user = null ][, int $permission = null ][, bool $update = true ]) : mixed
Parameters
$user : string = null

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

$permission : int = null

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

$update : bool = true

Whether to automatically update the backend.

Return values
mixed

save()

TODO

public save() : mixed
Return values
mixed

setCacheVersion()

Sets the revision number of the class.

public setCacheVersion(int $cacheVersion) : mixed
Parameters
$cacheVersion : int

The revision number of the class.

Return values
mixed

setData()

Set permission details.

public setData(string $data) : mixed
Parameters
$data : string

Permission details.

Return values
mixed

setName()

Set permission name

public setName(string $name) : mixed
Parameters
$name : string

Permission name.

Return values
mixed

setPerm()

TODO

public setPerm(mixed $permId, mixed $permission[, mixed $update = true ]) : mixed
Parameters
$permId : mixed
$permission : mixed
$update : mixed = true
Return values
mixed

unsetPerm()

TODO

public unsetPerm(mixed $permId, mixed $permission[, mixed $update = true ]) : mixed
Parameters
$permId : mixed
$permission : mixed
$update : mixed = true
Return values
mixed

updatePermissions()

Updates the permissions based on data passed in the array.

public updatePermissions(array<string|int, mixed> $perms) : mixed
Parameters
$perms : array<string|int, mixed>

An array containing the permissions which are to be updated.

Return values
mixed

Search results