Class Perms

Description

The Perms:: class provides the Horde permissions system.

$Horde: framework/Perms/Perms.php,v 1.80.10.22 2009/01/06 15:23:29 jan Exp $

Copyright 2001-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Perms/Perms.php (line 41)


	
			
Direct descendents
Class Description
 class Perms_datatree The Perms_datatree:: class provides a DataTree driver for the Horde permissions system.
 class Perms_sql The Perms_sql:: class provides a SQL driver for the Horde permissions system.
Variable Summary
Method Summary
 static string getShortName (string $name)
 void addPermission ( &$perm, Permission $perm)
 boolean exists (string $permission)
 Perms|boolean &factory ([string $driver = null], [array $params = null])
 array getApplicationPermissions (string $app)
 array getAvailable (string $name)
 array getParents (string $child)
 void &getPermission (string $name)
 void &getPermissionById (integer $cid)
 integer getPermissionId (Permission $permission)
 mixed getPermissions (mixed $permission, [string $user = null], [string $creator = null])
 array getPermsArray ()
 string getTitle (string $name)
 array getTree ()
 boolean hasPermission (string $permission, string $user, integer $perm, [string $creator = null])
 void integerToArray (integer $int)
 Permissions &newPermission (string $name)
 void removePermission ( &$perm, [boolean $force = false], Permission $perm)
 Perms|boolean &singleton ()
Variables
array $_applicationPermissions (line 48)

Caches information about application permissions.

Methods
static getShortName (line 123)

Returns the short name of an object, the last portion of the full name.

  • return: The object's short name.
static string getShortName (string $name)
  • string $name: The name of the object.
addPermission (line 231)

Adds a permission to the permissions system. The permission must first be created with Perm::newPermission(), and have any initial users added to it, before this function is called.

void addPermission ( &$perm, Permission $perm)
  • Permission $perm: The new perm object.
  • &$perm

Redefined in descendants as:
  • Perms_datatree::addPermission() : Adds a permission to the permissions system. The permission must first be created with Perm::newPermission(), and have any initial users added to it, before this function is called.
  • Perms_sql::addPermission() : Adds a permission to the permissions system. The permission must first be created with Perm::newPermission(), and have any initial users added to it, before this function is called.
exists (line 366)

Checks if a permission exists in the system.

  • return: True if the permission exists.
boolean exists (string $permission)
  • string $permission: The permission to check.

Redefined in descendants as:
factory (line 448)

Attempts to return a concrete Perms instance based on $driver.

  • return: The newly created concrete Perms instance, or false on an error.
Perms|boolean &factory ([string $driver = null], [array $params = null])
  • string $driver: The type of the concrete Perms subclass to return. The class name is based on the perms driver ($driver). The code is dynamically included.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
getApplicationPermissions (line 180)

Returns information about permissions implemented by an application.

  • return: Hash with permissions information.
  • since: Horde 3.1
array getApplicationPermissions (string $app)
  • string $app: An application name.
getAvailable (line 58)

Returns the available permissions for a given level.

  • return: An array of available permissions and their titles or false if not sub permissions exist for this level.
array getAvailable (string $name)
  • string $name: The permission's name.
getParents (line 378)

Returns a list of parent permissions.

  • return: A hash with all parents in a tree format.
array getParents (string $child)
  • string $child: The name of the child to retrieve parents for.

Redefined in descendants as:
getPermission (line 208)

Returns a Permission object corresponding to the named permission, with the users and other data retrieved appropriately.

void &getPermission (string $name)
  • string $name: The name of the permission to retrieve.

Redefined in descendants as:
  • Perms_datatree::getPermission() : Returns a DataTreeObject_Permission object corresponding to the named permission, with the users and other data retrieved appropriately.
  • Perms_sql::getPermission() : Returns a SQLObject_Permission object corresponding to the named permission, with the users and other data retrieved appropriately.
getPermissionById (line 219)

Returns a Permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.

void &getPermissionById (integer $cid)
  • integer $cid: The unique ID of the permission to retrieve.

Redefined in descendants as:
  • Perms_datatree::getPermissionById() : Returns a DataTreeObject_Permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
  • Perms_sql::getPermissionById() : Returns a SQLObject_Permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
getPermissionId (line 338)

Returns the unique identifier of this permission.

  • return: The unique id.
integer getPermissionId (Permission $permission)
  • Permission $permission: The permission object to get the ID of.

Redefined in descendants as:
getPermissions (line 260)

Finds out what rights the given user has to this object.

  • return: A bitmask of permissions the user has, false if there are none.
mixed getPermissions (mixed $permission, [string $user = null], [string $creator = null])
  • mixed $permission: The full permission name of the object to check the permissions of, or the Permission object.
  • string $user: The user to check for. Defaults to the current user.
  • string $creator: The user who created the event.
getPermsArray (line 398)

Returns an hash of the available permissions.

  • return: The available permissions as a hash.
array getPermsArray ()
getTitle (line 143)

Given a permission name, returns the title for that permission by looking it up in the applications's permission api.

  • return: The title for the permission.
string getTitle (string $name)
  • string $name: The permissions's name.
getTree (line 388)

Returns all permissions of the system in a tree format.

  • return: A hash with all permissions in a tree format.
array getTree ()

Redefined in descendants as:
hasPermission (line 354)

Finds out if the user has the specified rights to the given object.

  • return: True if the user has the specified permissions.
boolean hasPermission (string $permission, string $user, integer $perm, [string $creator = null])
  • string $permission: The permission to check.
  • string $user: The user to check for.
  • integer $perm: The permission level that needs to be checked for.
  • string $creator: The creator of the event
integerToArray (line 412)

Given an integer value of permissions returns an array representation of the integer.

void integerToArray (integer $int)
  • integer $int: The integer representation of permissions.
newPermission (line 197)

Returns a new permissions object.

  • return: A new permissions object.
Permissions &newPermission (string $name)
  • string $name: The permission's name.

Redefined in descendants as:
removePermission (line 242)

Removes a permission from the permissions system permanently.

void removePermission ( &$perm, [boolean $force = false], Permission $perm)
  • Permission $perm: The permission to remove.
  • boolean $force: Force to remove every child.
  • &$perm

Redefined in descendants as:
singleton (line 480)

Attempts to return a reference to a concrete Perms instance.

It will only create a new instance if no Perms instance currently exists.

This method must be invoked as: $var = &Perms::singleton()

  • return: The concrete Perm reference, or false on error.
Perms|boolean &singleton ()

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