Class Perms_sql

Description

The Perms_sql:: class provides a SQL driver for the Horde permissions system.

$Horde: framework/Perms/Perms/sql.php,v 1.1.2.17 2010-11-25 20:12:05 jan Exp $

Copyright 2008-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/sql.php (line 20)

Perms
   |
   --Perms_sql
Variable Summary
Method Summary
 Perms_sql Perms_sql ()
 void addPermission ( &$perm, SQLObject_Permission $perm)
 boolean exists (string $permission)
 mixed getParent (mixed $child)
 array getParents (string $child)
 void &getPermission (string $name)
 void &getPermissionById (integer $id)
 integer getPermissionId (SQLObject_Permission $permission)
 array &getTree ()
 SQLObject_Permissions &newPermission (string $name)
 void removePermission ( &$perm, [boolean $force = false], SQLObject_Permission $perm)
 boolean _connect ()
 void _getParents ( $parents)
Variables
Horde_Cache $_cache (line 49)

Pointer to a Horde_Cache instance

boolean $_connected = false (line 27)

Boolean indicating whether or not we're connected to the SQL server.

DB $_db (line 34)

Handle for the current database connection.

DB $_write_db (line 42)

Handle for the current database connection, used for writing. Defaults to the same handle as $db if a separate write database is not required.

Inherited Variables

Inherited from Perms

Perms::$_applicationPermissions
Methods
Constructor Perms_sql (line 54)

Constructor.

Perms_sql Perms_sql ()
addPermission (line 169)

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, SQLObject_Permission $perm)

Redefinition of:
Perms::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 269)

Checks if a permission exists in the system.

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

Redefinition of:
Perms::exists()
Checks if a permission exists in the system.
getParent (line 295)

Returns a child's direct parent ID.

  • return: The unique ID of the parent or PEAR_Error on error.
mixed getParent (mixed $child)
  • mixed $child: The object name for which to look up the parent's ID.
getParents (line 320)

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.

Redefinition of:
Perms::getParents()
Returns a list of parent permissions.
getPermission (line 94)

Returns a SQLObject_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.

Redefinition of:
Perms::getPermission()
Returns a Permission object corresponding to the named permission, with the users and other data retrieved appropriately.
getPermissionById (line 138)

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

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

Redefinition of:
Perms::getPermissionById()
Returns a Permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
getPermissionId (line 251)

Returns the unique identifier of this permission.

  • return: The unique id.
integer getPermissionId (SQLObject_Permission $permission)

Redefinition of:
Perms::getPermissionId()
Returns the unique identifier of this permission.
getTree (line 355)

Returns all permissions of the system in a tree format.

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

Redefinition of:
Perms::getTree()
Returns all permissions of the system in a tree format.
newPermission (line 67)

Returns a new permissions object.

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

Redefinition of:
Perms::newPermission()
Returns a new permissions object.
removePermission (line 222)

Removes a permission from the permissions system permanently.

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

Redefinition of:
Perms::removePermission()
Removes a permission from the permissions system permanently.
_connect (line 373)

Attempts to open a connection to the sql server.

  • return: True on success; exits (Horde::fatal()) on error.
boolean _connect ()
_getParents (line 336)
void _getParents ( $parents)
  • $parents

Inherited Methods

Inherited From Perms

 Perms::addPermission()
 Perms::exists()
 Perms::factory()
 Perms::getApplicationPermissions()
 Perms::getAvailable()
 Perms::getParents()
 Perms::getPermission()
 Perms::getPermissionById()
 Perms::getPermissionId()
 Perms::getPermissions()
 Perms::getPermsArray()
 Perms::getShortName()
 Perms::getTitle()
 Perms::getTree()
 Perms::hasPermission()
 Perms::integerToArray()
 Perms::newPermission()
 Perms::removePermission()
 Perms::singleton()

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