Overview

Packages

  • Perms

Classes

  • Horde_Perms
  • Horde_Perms_Base
  • Horde_Perms_Datatree
  • Horde_Perms_Exception
  • Horde_Perms_Null
  • Horde_Perms_Permission
  • Horde_Perms_Permission_Datatree
  • Horde_Perms_Permission_Kolab
  • Horde_Perms_Permission_Kolab_Acl
  • Horde_Perms_Permission_Kolab_Acl_Anonymous
  • Horde_Perms_Permission_Kolab_Acl_Anyone
  • Horde_Perms_Permission_Kolab_Acl_Creator
  • Horde_Perms_Permission_Kolab_Acl_Group
  • Horde_Perms_Permission_Kolab_Acl_User
  • Horde_Perms_Permission_Kolab_AclIterator
  • Horde_Perms_Permission_Kolab_Element
  • Horde_Perms_Permission_Kolab_Element_Creator
  • Horde_Perms_Permission_Kolab_Element_Default
  • Horde_Perms_Permission_Kolab_Element_Group
  • Horde_Perms_Permission_Kolab_Element_Guest
  • Horde_Perms_Permission_Kolab_Element_User
  • Horde_Perms_Permission_Kolab_ElementIterator
  • Horde_Perms_Permission_Sql
  • Horde_Perms_Sql
  • Horde_Perms_Translation

Interfaces

  • Horde_Perms_Permission_Kolab_Storage
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Perms_Sql

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

Copyright 2008-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.

Horde_Perms_Base
Extended by Horde_Perms_Sql
Package: Perms
Category: Horde
Author: Duck duck@obala.net
Located at Horde/Perms/Sql.php
Methods summary
public
# __construct( array $params = array() )

Constructor.

Constructor.

Parameters

$params
<p>Configuration parameters (in addition to base Horde_Perms parameters):</p> <pre><span class="php-quote">'db'</span> - (Horde_Db_Adapter) [REQUIRED] The DB instance. <span class="php-quote">'table'</span> - (string) The name of the perms table. <span class="php-keyword1">DEFAULT</span>: <span class="php-quote">'horde_perms'</span></pre>

Throws

Horde_Perms_Exception

Overrides

Horde_Perms_Base::__construct()
public Horde_Perms_Permission_Sql
# newPermission( string $name, string $type = 'matrix', array $params = null )

Returns a new permissions object.

Returns a new permissions object.

Parameters

$name
The permission's name.
$type
The permission type.
$params
The permission parameters.

Returns

Horde_Perms_Permission_Sql
A new permissions object.

Throws

Horde_Perms_Exception
public Horde_Perms_Permission_Sql
# getPermission( string $name )

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

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

Parameters

$name
The name of the permission to retrieve.

Returns

Horde_Perms_Permission_Sql
TODO

Throws

Horde_Perms_Exception

Throw

Horde_Perms_Exception
public Horde_Perms_Permission_Sql
# getPermissionById( integer $id )

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

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

Parameters

$id
The unique ID of the permission to retrieve.

Returns

Horde_Perms_Permission_Sql
TODO

Throws

Horde_Perms_Exception
public integer
# addPermission( Horde_Perms_Permission $perm )

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

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

Parameters

$perm
The perm object.

Returns

integer
Permission ID in the database.

Throws

Horde_Perms_Exception
public boolean
# removePermission( Horde_Perms_Permission $perm, boolean $force = false )

Removes a permission from the permissions system permanently.

Removes a permission from the permissions system permanently.

Parameters

$perm
<p>The permission to remove.</p>
$force
<p>Force to remove every child.</p>

Returns

boolean
True if permission was deleted.

Throws

Horde_Perms_Exception
public integer
# getPermissionId( Horde_Perms_Permission_Sql $permission )

Returns the unique identifier of this permission.

Returns the unique identifier of this permission.

Parameters

$permission
<p>$perm The permission object to get the ID of.</p>

Returns

integer
The unique id.

Throws

Horde_Perms_Exception
public boolean
# exists( string $permission )

Checks if a permission exists in the system.

Checks if a permission exists in the system.

Parameters

$permission
The permission to check.

Returns

boolean
True if the permission exists.

Throws

Horde_Perms_Exception
public integer
# getParent( mixed $child )

Returns a child's direct parent ID.

Returns a child's direct parent ID.

Parameters

$child
<p>The object name for which to look up the parent's ID.</p>

Returns

integer
The unique ID of the parent.

Throws

Horde_Perms_Exception
public array
# getParents( string $child )

Returns a list of parent permissions.

Returns a list of parent permissions.

Parameters

$child
The name of the child to retrieve parents for.

Returns

array
A hash with all parents in a tree format.

Throws

Horde_Perms_Exception
public array
# getTree( )

Returns all permissions of the system in a tree format.

Returns all permissions of the system in a tree format.

Returns

array
A hash with all permissions in a tree format.

Throws

Horde_Perms_Exception
Methods inherited from Horde_Perms_Base
getPermissions(), getShortName(), hasPermission()
API documentation generated by ApiGen