PHP Class 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.
Author: Chuck Hagenbuch ([email protected])
Author: Jan Schneider ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Свойство Type Description
$data TODO
$name TODO

Protected Properties

Свойство Type Description
$_cacheVersion integer Incrementing version number if cached classes change.

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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() public méthode

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() public méthode

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() public méthode

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() public méthode

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() public méthode

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() public méthode

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.
Résultat mixed The value of the attribute, or null.

getCreatorPermissions() public méthode

Returns the creator permissions on this object.
public getCreatorPermissions ( ) : integer
Résultat integer The creator permissions on this object.

getData() public méthode

Get permission details.
public getData ( ) : array
Résultat array Permission details.

getDefaultPermissions() public méthode

Returns the default permissions on this object.
public getDefaultPermissions ( ) : integer
Résultat integer The default permissions on this object.

getGroupPermissions() public méthode

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.
Résultat array All group permissions for this object, indexed by group.

getGuestPermissions() public méthode

Returns the guest permissions on this object.
public getGuestPermissions ( ) : integer
Résultat integer The guest permissions on this object.

getName() public méthode

Get permission name.
public getName ( ) : string
Résultat string Permission name.

getUserPermissions() public méthode

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.
Résultat array All user permissions for this object, indexed by user.

removeCreatorPermission() public méthode

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() public méthode

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() public méthode

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() public méthode

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() public méthode

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() public méthode

TODO
public save ( )

setCacheVersion() public méthode

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

setData() public méthode

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

setName() public méthode

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

setPerm() public méthode

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

unsetPerm() public méthode

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

updatePermissions() public méthode

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.

Property Details

$_cacheVersion protected_oe property

Incrementing version number if cached classes change.
protected int $_cacheVersion
Résultat integer

$data public_oe property

TODO
public $data

$name public_oe property

TODO
public $name