Instance of a single permissioning object.
Copyright 2009-2012 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.
Methods summary
public
|
#
__construct( string $name, integer $cacheVersion = null, string $type = 'matrix', array $params = null )
Constructor.
Parameters
- $name
- The name of the perm.
- $cacheVersion
- The revision number of the class.
- $type
- The permission type.
- $params
- <p>A hash with any parameters that the
permission type needs.</p>
|
public
|
#
setCacheVersion( integer $cacheVersion )
Sets the revision number of the class.
Sets the revision number of the class.
Parameters
- $cacheVersion
- The revision number of the class.
|
public
mixed
|
#
get( string $attribute )
Gets one of the attributes of the object, or null if it isn't defined.
Gets one of the attributes of the object, or null if it isn't defined.
Parameters
- $attribute
- The attribute to get.
Returns
mixed The value of the attribute, or null.
|
public
string
|
#
getName( )
Get permission name.
Returns
string Permission name.
|
public
|
#
setName( string $name )
Set permission name
Parameters
|
public
array
|
#
getData( )
Get permission details.
Returns
array Permission details.
|
public
|
#
setData( string $data )
Set permission details.
Parameters
- $data
- Permission details.
|
public
|
#
updatePermissions( array $perms )
Updates the permissions based on data passed in the array.
Updates the permissions based on data passed in the array.
Parameters
- $perms
- <p>An array containing the permissions which are to
be updated.</p>
|
public
|
#
setPerm( mixed $permId, mixed $permission, mixed $update = true )
|
public
|
#
unsetPerm( mixed $permId, mixed $permission, mixed $update = true )
|
public
|
#
addUserPermission( string $user, integer $permission, boolean $update = true )
Grants a user additional permissions to this object.
Grants a user additional permissions to this object.
Parameters
- $user
- <p>$uer The user to grant additional permissions
to.</p>
- $permission
- The permission (DELETE, etc.) to add.
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
addGuestPermission( integer $permission, boolean $update = true )
Grants guests additional permissions to this object.
Grants guests additional permissions to this object.
Parameters
- $permission
- The permission (DELETE, etc.) to add.
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
addCreatorPermission( integer $permission, boolean $update = true )
Grants creators additional permissions to this object.
Grants creators additional permissions to this object.
Parameters
- $permission
- The permission (DELETE, etc.) to add.
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
addDefaultPermission( integer $permission, boolean $update = true )
Grants additional default permissions to this object.
Grants additional default permissions to this object.
Parameters
- $permission
- The permission (DELETE, etc.) to add.
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
addGroupPermission( integer $groupId, integer $permission, boolean $update = true )
Grants a group additional permissions to this object.
Grants a group additional permissions to this object.
Parameters
- $groupId
- <p>The id of the group to grant additional
permissions to.</p>
- $permission
- The permission (DELETE, etc.) to add.
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
removeUserPermission( string $user = null, integer $permission = null, boolean $update = true )
Removes a permission that a user currently has on this object.
Removes a permission that a user currently has on this object.
Parameters
- $user
- <p>The user to remove the permission from.
Defaults to all users.</p>
- $permission
- <p>The permission (DELETE, etc.) to
remove. Defaults to all permissions.</p>
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
removeGuestPermission( integer $permission = null, boolean $update = true )
Removes a permission that guests currently have on this object.
Removes a permission that guests currently have on this object.
Parameters
- $permission
- <p>The permission (DELETE, etc.) to
remove. Defaults to all permissions.</p>
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
removeCreatorPermission( integer $permission = null, boolean $update = true )
Removes a permission that creators currently have on this object.
Removes a permission that creators currently have on this object.
Parameters
- $permission
- <p>The permission (DELETE, etc.) to
remove. Defaults to all permissions.</p>
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
removeDefaultPermission( integer $permission = null, boolean $update = true )
Removes a default permission on this object.
Removes a default permission on this object.
Parameters
- $permission
- <p>The permission (DELETE, etc.) to
remove. Defaults to all permissions.</p>
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
|
#
removeGroupPermission( integer $groupId = null, integer $permission = null, boolean $update = true )
Removes a permission that a group currently has on this object.
Removes a permission that a group currently has on this object.
Parameters
- $groupId
- <p>The id of the group to remove the
permission from. Defaults to all groups.</p>
- $permission
- <p>The permission (DELETE, etc.) to
remove. Defaults to all permissions.</p>
- $update
- <p>Whether to automatically update the
backend.</p>
|
public
array
|
#
getUserPermissions( integer $perm = null )
Returns an array of all user permissions on this object.
Returns an array of all user permissions on this object.
Parameters
- $perm
- <p>List only users with this permission level.
Defaults to all users.</p>
Returns
array All user permissions for this object, indexed by user.
|
public
integer
|
#
getGuestPermissions( )
Returns the guest permissions on this object.
Returns the guest permissions on this object.
Returns
integer The guest permissions on this object.
|
public
integer
|
#
getCreatorPermissions( )
Returns the creator permissions on this object.
Returns the creator permissions on this object.
Returns
integer The creator permissions on this object.
|
public
integer
|
#
getDefaultPermissions( )
Returns the default permissions on this object.
Returns the default permissions on this object.
Returns
integer The default permissions on this object.
|
public
array
|
#
getGroupPermissions( integer $perm = null )
Returns an array of all group permissions on this object.
Returns an array of all group permissions on this object.
Parameters
- $perm
- <p>List only users with this permission level.
Defaults to all users.</p>
Returns
array All group permissions for this object, indexed by group.
|
public
|
|