PHP Класс Horde_Perms_Permission, horde

Copyright 2009-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Автор: Chuck Hagenbuch ([email protected])
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$data TODO
$name TODO

Защищенные свойства (Protected)

Свойство Тип Описание
$_cacheVersion integer Incrementing version number if cached classes change.

Открытые методы

Метод Описание
__construct ( string $name, integer $cacheVersion = null, string $type = 'matrix', array $params = null ) Constructor.
addCreatorPermission ( integer $permission, boolean $update = true ) Grants creators additional permissions to this object.
addDefaultPermission ( integer $permission, boolean $update = true ) Grants additional default permissions to this object.
addGroupPermission ( integer $groupId, integer $permission, boolean $update = true ) Grants a group additional permissions to this object.
addGuestPermission ( integer $permission, boolean $update = true ) Grants guests additional permissions to this object.
addUserPermission ( $user, integer $permission, boolean $update = true ) Grants a user additional permissions to this object.
get ( string $attribute ) : mixed Gets one of the attributes of the object, or null if it isn't defined.
getCreatorPermissions ( ) : integer Returns the creator permissions on this object.
getData ( ) : array Get permission details.
getDefaultPermissions ( ) : integer Returns the default permissions on this object.
getGroupPermissions ( integer $perm = null ) : array Returns an array of all group permissions on this object.
getGuestPermissions ( ) : integer Returns the guest permissions on this object.
getName ( ) : string Get permission name.
getUserPermissions ( integer $perm = null ) : array Returns an array of all user permissions on this object.
removeCreatorPermission ( integer $permission = null, boolean $update = true ) Removes a permission that creators currently have on this object.
removeDefaultPermission ( integer $permission = null, boolean $update = true ) Removes a default permission on this object.
removeGroupPermission ( integer $groupId = null, integer $permission = null, boolean $update = true ) Removes a permission that a group currently has on this object.
removeGuestPermission ( integer $permission = null, boolean $update = true ) Removes a permission that guests currently have on this object.
removeUserPermission ( string $user = null, integer $permission = null, boolean $update = true ) Removes a permission that a user currently has on this object.
save ( ) TODO
setCacheVersion ( integer $cacheVersion ) Sets the revision number of the class.
setData ( string $data ) Set permission details.
setName ( string $name ) Set permission name
setPerm ( $permId, $permission, $update = true ) TODO
unsetPerm ( $permId, $permission, $update = true ) TODO
updatePermissions ( array $perms ) Updates the permissions based on data passed in the array.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( string $name, integer $cacheVersion = null, string $type = 'matrix', array $params = null )
$name string The name of the perm.
$cacheVersion integer The revision number of the class.
$type string The permission type.
$params array A hash with any parameters that the permission type needs.

addCreatorPermission() публичный Метод

Grants creators additional permissions to this object.
public addCreatorPermission ( integer $permission, boolean $update = true )
$permission integer The permission (DELETE, etc.) to add.
$update boolean Whether to automatically update the backend.

addDefaultPermission() публичный Метод

Grants additional default permissions to this object.
public addDefaultPermission ( integer $permission, boolean $update = true )
$permission integer The permission (DELETE, etc.) to add.
$update boolean Whether to automatically update the backend.

addGroupPermission() публичный Метод

Grants a group additional permissions to this object.
public addGroupPermission ( integer $groupId, integer $permission, boolean $update = true )
$groupId integer The id of the group to grant additional permissions to.
$permission integer The permission (DELETE, etc.) to add.
$update boolean Whether to automatically update the backend.

addGuestPermission() публичный Метод

Grants guests additional permissions to this object.
public addGuestPermission ( integer $permission, boolean $update = true )
$permission integer The permission (DELETE, etc.) to add.
$update boolean Whether to automatically update the backend.

addUserPermission() публичный Метод

Grants a user additional permissions to this object.
public addUserPermission ( $user, integer $permission, boolean $update = true )
$permission integer The permission (DELETE, etc.) to add.
$update boolean Whether to automatically update the backend.

get() публичный Метод

Gets one of the attributes of the object, or null if it isn't defined.
public get ( string $attribute ) : mixed
$attribute string The attribute to get.
Результат mixed The value of the attribute, or null.

getCreatorPermissions() публичный Метод

Returns the creator permissions on this object.
public getCreatorPermissions ( ) : integer
Результат integer The creator permissions on this object.

getData() публичный Метод

Get permission details.
public getData ( ) : array
Результат array Permission details.

getDefaultPermissions() публичный Метод

Returns the default permissions on this object.
public getDefaultPermissions ( ) : integer
Результат integer The default permissions on this object.

getGroupPermissions() публичный Метод

Returns an array of all group permissions on this object.
public getGroupPermissions ( integer $perm = null ) : array
$perm integer List only users with this permission level. Defaults to all users.
Результат array All group permissions for this object, indexed by group.

getGuestPermissions() публичный Метод

Returns the guest permissions on this object.
public getGuestPermissions ( ) : integer
Результат integer The guest permissions on this object.

getName() публичный Метод

Get permission name.
public getName ( ) : string
Результат string Permission name.

getUserPermissions() публичный Метод

Returns an array of all user permissions on this object.
public getUserPermissions ( integer $perm = null ) : array
$perm integer List only users with this permission level. Defaults to all users.
Результат array All user permissions for this object, indexed by user.

removeCreatorPermission() публичный Метод

Removes a permission that creators currently have on this object.
public removeCreatorPermission ( integer $permission = null, boolean $update = true )
$permission integer The permission (DELETE, etc.) to remove. Defaults to all permissions.
$update boolean Whether to automatically update the backend.

removeDefaultPermission() публичный Метод

Removes a default permission on this object.
public removeDefaultPermission ( integer $permission = null, boolean $update = true )
$permission integer The permission (DELETE, etc.) to remove. Defaults to all permissions.
$update boolean Whether to automatically update the backend.

removeGroupPermission() публичный Метод

Removes a permission that a group currently has on this object.
public removeGroupPermission ( integer $groupId = null, integer $permission = null, boolean $update = true )
$groupId integer The id of the group to remove the permission from. Defaults to all groups.
$permission integer The permission (DELETE, etc.) to remove. Defaults to all permissions.
$update boolean Whether to automatically update the backend.

removeGuestPermission() публичный Метод

Removes a permission that guests currently have on this object.
public removeGuestPermission ( integer $permission = null, boolean $update = true )
$permission integer The permission (DELETE, etc.) to remove. Defaults to all permissions.
$update boolean Whether to automatically update the backend.

removeUserPermission() публичный Метод

Removes a permission that a user currently has on this object.
public removeUserPermission ( string $user = null, integer $permission = null, boolean $update = true )
$user string The user to remove the permission from. Defaults to all users.
$permission integer The permission (DELETE, etc.) to remove. Defaults to all permissions.
$update boolean Whether to automatically update the backend.

save() публичный Метод

TODO
public save ( )

setCacheVersion() публичный Метод

Sets the revision number of the class.
public setCacheVersion ( integer $cacheVersion )
$cacheVersion integer The revision number of the class.

setData() публичный Метод

Set permission details.
public setData ( string $data )
$data string Permission details.

setName() публичный Метод

Set permission name
public setName ( string $name )
$name string Permission name.

setPerm() публичный Метод

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

unsetPerm() публичный Метод

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

updatePermissions() публичный Метод

Updates the permissions based on data passed in the array.
public updatePermissions ( array $perms )
$perms array An array containing the permissions which are to be updated.

Описание свойств

$_cacheVersion защищенное свойство

Incrementing version number if cached classes change.
protected int $_cacheVersion
Результат integer

$data публичное свойство

TODO
public $data

$name публичное свойство

TODO
public $name