Class DataTreeObject_Permission

Description

Extension of the DataTreeObject class for storing Permission information in the DataTree driver. If you want to store specialized Permission information, you should extend this class instead of extending DataTreeObject directly.

  • author: Chuck Hagenbuch <chuck@horde.org>
  • author: Jan Schneider <jan@horde.org>
  • TODO: This class duplicates most of the functionality of the Horde_Permission class. However, because for BC/DataTree reasons it must extend DataTreeObject, we can't remove these methods yet.
  • since: Horde 2.1

Located in /Perms/Perms/datatree.php (line 262)

DataTreeObject
   |
   --DataTreeObject_Permission
Method Summary
 DataTreeObject_Permission DataTreeObject_Permission (string $name, [string $type = 'matrix'], [array $params = null])
 void addCreatorPermission (constant $permission, [boolean $update = true])
 void addDefaultPermission (constant $permission, [boolean $update = true])
 void addGroupPermission (integer $groupId, constant $permission, [boolean $update = true])
 void addGuestPermission (constant $permission, [boolean $update = true])
 void addUserPermission (string $user, constant $permission, [boolean $update = true])
 mixed get (string $attribute)
 array getGroupPermissions ([integer $perm = null])
 integer getGuestPermissions ()
 array getUserPermissions ([integer $perm = null])
 void removeCreatorPermission (constant $permission, [boolean $update = true])
 void removeDefaultPermission (constant $permission, [boolean $update = true])
 void removeGroupPermission (integer $groupId, constant $permission, [boolean $update = true])
 void removeGuestPermission (constant $permission, [boolean $update = true])
 void removeUserPermission (string $user, constant $permission, [boolean $update = true])
 boolean|PEAR_Error save ()
 void setPerm ( $permId,  $permission, [ $update = true])
 void unsetPerm ( $permId,  $permission, [ $update = true])
 void updatePermissions (array $perms)
Variables
Methods
Constructor DataTreeObject_Permission (line 273)

The DataTreeObject_Permission constructor. Just makes sure to call the parent constructor so that the perm's name is set properly.

DataTreeObject_Permission DataTreeObject_Permission (string $name, [string $type = 'matrix'], [array $params = null])
  • string $name: The name of the perm.
  • string $type: The permission type.
  • array $params: A hash with any parameters that the permission type needs.
addCreatorPermission (line 504)

Grants creators additional permissions to this object.

void addCreatorPermission (constant $permission, [boolean $update = true])
  • constant $permission: The permission (PERMS_DELETE, etc.) to add.
  • boolean $update: Whether to automatically update the backend.
addDefaultPermission (line 525)

Grants additional default permissions to this object.

void addDefaultPermission (constant $permission, [boolean $update = true])
  • constant $permission: The permission (PERMS_DELETE, etc.) to add.
  • boolean $update: Whether to automatically update the backend.
addGroupPermission (line 548)

Grants a group additional permissions to this object.

void addGroupPermission (integer $groupId, constant $permission, [boolean $update = true])
  • integer $groupId: The id of the group to grant additional permissions to.
  • constant $permission: The permission (PERMS_DELETE, etc.) to add.
  • boolean $update: Whether to automatically update the backend.
addGuestPermission (line 483)

Grants guests additional permissions to this object.

void addGuestPermission (constant $permission, [boolean $update = true])
  • constant $permission: The permission (PERMS_DELETE, etc.) to add.
  • boolean $update: Whether to automatically update the backend.
addUserPermission (line 459)

Grants a user additional permissions to this object.

void addUserPermission (string $user, constant $permission, [boolean $update = true])
  • string $user: The user to grant additional permissions to.
  • constant $permission: The permission (PERMS_DELETE, etc.) to add.
  • boolean $update: Whether to automatically update the backend.
get (line 289)

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

  • return: The value of the attribute, or null.
mixed get (string $attribute)
  • string $attribute: The attribute to get.

Redefinition of:
DataTreeObject::get()
Gets one of the attributes of the object, or null if it isn't defined.
getCreatorPermissions (line 750)

Returns the creator permissions on this object.

  • return: The creator permissions on this object.
integer getCreatorPermissions ()
getDefaultPermissions (line 762)

Returns the default permissions on this object.

  • return: The default permissions on this object.
integer getDefaultPermissions ()
getGroupPermissions (line 777)

Returns an array of all group permissions on this object.

  • return: All group permissions for this object, indexed by group.
array getGroupPermissions ([integer $perm = null])
  • integer $perm: List only users with this permission level. Defaults to all users.
getGuestPermissions (line 738)

Returns the guest permissions on this object.

  • return: The guest permissions on this object.
integer getGuestPermissions ()
getUserPermissions (line 716)

Returns an array of all user permissions on this object.

  • return: All user permissions for this object, indexed by user.
array getUserPermissions ([integer $perm = null])
  • integer $perm: List only users with this permission level. Defaults to all users.
removeCreatorPermission (line 630)

Removes a permission that creators currently have on this object.

void removeCreatorPermission (constant $permission, [boolean $update = true])
  • constant $permission: The permission (PERMS_DELETE, etc.) to remove.
  • boolean $update: Whether to automatically update the backend.
removeDefaultPermission (line 657)

Removes a default permission on this object.

void removeDefaultPermission (constant $permission, [boolean $update = true])
  • constant $permission: The permission (PERMS_DELETE, etc.) to remove.
  • boolean $update: Whether to automatically update the backend.
removeGroupPermission (line 686)

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

void removeGroupPermission (integer $groupId, constant $permission, [boolean $update = true])
  • integer $groupId: The id of the group to remove the permission from.
  • constant $permission: The permission (PERMS_DELETE, etc.) to remove.
  • boolean $update: Whether to automatically update the backend.
removeGuestPermission (line 603)

Removes a permission that guests currently have on this object.

void removeGuestPermission (constant $permission, [boolean $update = true])
  • constant $permission: The permission (PERMS_DELETE, etc.) to remove.
  • boolean $update: Whether to automatically update the backend.
removeUserPermission (line 575)

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

void removeUserPermission (string $user, constant $permission, [boolean $update = true])
  • string $user: The user to remove the permission from.
  • constant $permission: The permission (PERMS_DELETE, etc.) to remove.
  • boolean $update: Whether to automatically update the backend.
save (line 801)

Saves any changes to this object to the backend permanently. New objects are added instead.

  • return: PEAR_Error on failure.
boolean|PEAR_Error save ()

Redefinition of:
DataTreeObject::save()
Saves any changes to this object to the backend permanently. New objects are added instead.
setPerm (line 382)

FIXME: needs docs

void setPerm ( $permId,  $permission, [ $update = true])
  • $permId
  • $permission
  • $update
unsetPerm (line 411)

FIXME: needs docs

void unsetPerm ( $permId,  $permission, [ $update = true])
  • $permId
  • $permission
  • $update
updatePermissions (line 304)

Updates the permissions based on data passed in the array.

void updatePermissions (array $perms)
  • array $perms: An array containing the permissions which are to be updated.

Inherited Methods

Inherited From DataTreeObject

 DataTreeObject::DataTreeObject()
 DataTreeObject::delete()
 DataTreeObject::get()
 DataTreeObject::getChild()
 DataTreeObject::getData()
 DataTreeObject::getId()
 DataTreeObject::getName()
 DataTreeObject::getParent()
 DataTreeObject::getShortName()
 DataTreeObject::save()
 DataTreeObject::set()
 DataTreeObject::setData()
 DataTreeObject::setDataTree()
 DataTreeObject::setName()
 DataTreeObject::setOrder()

Documentation generated on Sun, 30 Jan 2011 05:16:30 +0000 by phpDocumentor 1.4.3