PHP 클래스 Horde_Perms_Sql, horde

Copyright 2008-2016 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.
저자: Duck ([email protected])
상속: extends Horde_Perms_Base
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_db Horde_Db_Adapter Handle for the current database connection.
$_params array Configuration parameters.
$_permsCache array Cache of previously retrieved permissions.

공개 메소드들

메소드 설명
__construct ( array $params = [] ) Constructor.
addPermission ( Horde_Perms_Permission $perm ) : integer 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.
exists ( string $permission ) : boolean Checks if a permission exists in the system.
getParent ( mixed $child ) : integer Returns a child's direct parent ID.
getParents ( string $child ) : array Returns a list of parent permissions.
getPermission ( string $name ) : Horde_Perms_Permission_Sql Returns an object corresponding to the named permission, with the users and other data retrieved appropriately.
getPermissionById ( integer $id ) : Horde_Perms_Permission_Sql Returns a permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
getPermissionId ( $permission ) : integer Returns the unique identifier of this permission.
getTree ( ) : array Returns all permissions of the system in a tree format.
newPermission ( string $name, string $type = 'matrix', array $params = null ) : Horde_Perms_Permission_Sql Returns a new permissions object.
removePermission ( Horde_Perms_Permission $perm, boolean $force = false ) : boolean Removes a permission from the permissions system permanently.

보호된 메소드들

메소드 설명
_getParents ( $parents ) TODO

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters (in addition to base Horde_Perms parameters):
'db' - (Horde_Db_Adapter) [REQUIRED] The DB instance.
'table' - (string) The name of the perms table.
          DEFAULT: 'horde_perms'

_getParents() 보호된 메소드

TODO
protected _getParents ( $parents )

addPermission() 공개 메소드

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.
public addPermission ( Horde_Perms_Permission $perm ) : integer
$perm Horde_Perms_Permission The perm object.
리턴 integer Permission ID in the database.

exists() 공개 메소드

Checks if a permission exists in the system.
public exists ( string $permission ) : boolean
$permission string The permission to check.
리턴 boolean True if the permission exists.

getParent() 공개 메소드

Returns a child's direct parent ID.
public getParent ( mixed $child ) : integer
$child mixed The object name for which to look up the parent's ID.
리턴 integer The unique ID of the parent.

getParents() 공개 메소드

Returns a list of parent permissions.
public getParents ( string $child ) : array
$child string The name of the child to retrieve parents for.
리턴 array A hash with all parents in a tree format.

getPermission() 공개 메소드

Returns an object corresponding to the named permission, with the users and other data retrieved appropriately.
public getPermission ( string $name ) : Horde_Perms_Permission_Sql
$name string The name of the permission to retrieve.
리턴 Horde_Perms_Permission_Sql TODO

getPermissionById() 공개 메소드

Returns a permission object corresponding to the given unique ID, with the users and other data retrieved appropriately.
public getPermissionById ( integer $id ) : Horde_Perms_Permission_Sql
$id integer The unique ID of the permission to retrieve.
리턴 Horde_Perms_Permission_Sql TODO

getPermissionId() 공개 메소드

Returns the unique identifier of this permission.
public getPermissionId ( $permission ) : integer
리턴 integer The unique id.

getTree() 공개 메소드

Returns all permissions of the system in a tree format.
public getTree ( ) : array
리턴 array A hash with all permissions in a tree format.

newPermission() 공개 메소드

Returns a new permissions object.
public newPermission ( string $name, string $type = 'matrix', array $params = null ) : Horde_Perms_Permission_Sql
$name string The permission's name.
$type string The permission type.
$params array The permission parameters.
리턴 Horde_Perms_Permission_Sql A new permissions object.

removePermission() 공개 메소드

Removes a permission from the permissions system permanently.
public removePermission ( Horde_Perms_Permission $perm, boolean $force = false ) : boolean
$perm Horde_Perms_Permission The permission to remove.
$force boolean Force to remove every child.
리턴 boolean True if permission was deleted.

프로퍼티 상세

$_db 보호되어 있는 프로퍼티

Handle for the current database connection.
protected Horde_Db_Adapter $_db
리턴 Horde_Db_Adapter

$_params 보호되어 있는 프로퍼티

Configuration parameters.
protected array $_params
리턴 array

$_permsCache 보호되어 있는 프로퍼티

Cache of previously retrieved permissions.
protected array $_permsCache
리턴 array