\Horde_Core_Perms

The Horde_Core_Perms class provides information about internal Horde elements that can be managed through the Horde_Perms system.

Copyright 2001-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Summary

Methods
Properties
Constants
__construct()
getAvailable()
getTitle()
getType()
getParams()
newPermission()
getApplicationPermissions()
hasAppPermission()
No public properties found
No constants found
No protected methods found
$_registry
$_perms
$_appPerms
N/A
No private methods found
No private properties found
N/A

Properties

$_registry

$_registry : \Horde_Registry

A registry instance.

Type

\Horde_Registry

$_perms

$_perms : \Horde_Perms_Base

A permissions instance.

Type

\Horde_Perms_Base

$_appPerms

$_appPerms : array

Caches information about application permissions.

Type

array

Methods

__construct()

__construct(\Horde_Registry  $registry, \Horde_Perms_Base  $perms) 

Constructor.

Parameters

\Horde_Registry $registry
\Horde_Perms_Base $perms

getAvailable()

getAvailable(string  $name) : array

Returns the available permissions for a given level.

Parameters

string $name

The permission's name.

Throws

\Horde_Perms_Exception

Returns

array —

An array of available permissions and their titles or false if not sub permissions exist for this level.

getTitle()

getTitle(string  $name) : string

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

Parameters

string $name

The permissions's name.

Returns

string —

The title for the permission.

getType()

getType(string  $name) : string

Given a permission name, returns the type for that permission.

Parameters

string $name

The permissions's name.

Returns

string —

The type for the permission.

getParams()

getParams(string  $name) : array

Given a permission name, returns the parameters for that permission.

Parameters

string $name

The permissions's name.

Returns

array —

The paramters for the permission.

newPermission()

newPermission(string  $name) : \Horde_Perms_Permission

Returns a new permissions object.

This must be used instead of Horde_Perms_Base::newPermission() because it works with application-specific permissions.

Parameters

string $name

The permission's name.

Returns

\Horde_Perms_Permission —

A new permissions object.

getApplicationPermissions()

getApplicationPermissions(string  $app) : array

Returns information about permissions implemented by an application.

Parameters

string $app

An application name.

Returns

array —

Hash with permissions information.

hasAppPermission()

hasAppPermission(string  $permission, array  $opts = array()) : mixed

Finds out if the user has the specified rights to the given object, specific to a certain application.

Parameters

string $permission

The permission to check.

array $opts

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

Returns

mixed —

The specified permissions.