PHP Class Horde_Core_Perms, horde

Copyright 2001-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.
Author: Chuck Hagenbuch ([email protected])
Author: Jan Schneider ([email protected])
Datei anzeigen Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_appPerms array Caches information about application permissions.
$_perms Horde_Perms_Base A permissions instance.
$_registry Horde_Registry A registry instance.

Public Methods

Method Description
__construct ( Horde_Registry $registry, Horde_Perms_Base $perms ) Constructor.
getApplicationPermissions ( string $app ) : array Returns information about permissions implemented by an application.
getAvailable ( string $name ) : array Returns the available permissions for a given level.
getParams ( string $name ) : array Given a permission name, returns the parameters for that permission.
getTitle ( string $name ) : string Given a permission name, returns the title for that permission by looking it up in the applications's permission api.
getType ( string $name ) : string Given a permission name, returns the type for that permission.
hasAppPermission ( string $permission, array $opts = [] ) : mixed Finds out if the user has the specified rights to the given object, specific to a certain application.
newPermission ( string $name ) : Horde_Perms_Permission Returns a new permissions object.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Registry $registry, Horde_Perms_Base $perms )
$registry Horde_Registry
$perms Horde_Perms_Base

getApplicationPermissions() public method

Returns information about permissions implemented by an application.
public getApplicationPermissions ( string $app ) : array
$app string An application name.
return array Hash with permissions information.

getAvailable() public method

Returns the available permissions for a given level.
public getAvailable ( string $name ) : array
$name string The permission's name.
return array An array of available permissions and their titles or false if not sub permissions exist for this level.

getParams() public method

Given a permission name, returns the parameters for that permission.
public getParams ( string $name ) : array
$name string The permissions's name.
return array The paramters for the permission.

getTitle() public method

Given a permission name, returns the title for that permission by looking it up in the applications's permission api.
public getTitle ( string $name ) : string
$name string The permissions's name.
return string The title for the permission.

getType() public method

Given a permission name, returns the type for that permission.
public getType ( string $name ) : string
$name string The permissions's name.
return string The type for the permission.

hasAppPermission() public method

Finds out if the user has the specified rights to the given object, specific to a certain application.
public hasAppPermission ( string $permission, array $opts = [] ) : mixed
$permission string The permission to check.
$opts array Additional options:
'app' - (string) The app to check.
        DEFAULT: The current pushed app.
'opts' - (array) Additional options to pass to the app function.
         DEFAULT: None
return mixed The specified permissions.

newPermission() public method

This must be used instead of Horde_Perms_Base::newPermission() because it works with application-specific permissions.
public newPermission ( string $name ) : Horde_Perms_Permission
$name string The permission's name.
return Horde_Perms_Permission A new permissions object.

Property Details

$_appPerms protected_oe property

Caches information about application permissions.
protected array $_appPerms
return array

$_perms protected_oe property

A permissions instance.
protected Horde_Perms_Base $_perms
return Horde_Perms_Base

$_registry protected_oe property

A registry instance.
protected Horde_Registry $_registry
return Horde_Registry