Static Public Member Functions |
| static & | getInstance () |
| static | setDelegate ($del) |
| static | addContextMask (Dataface_RelatedRecord $contextRecord) |
| static | removeContextMask (Dataface_RelatedRecord $contextRecord) |
| static & | getContextMasks () |
| static & | getContextMask ($id, $fieldname=null) |
| static & | getContext () |
| static | setContext ($context) |
| static | clearContext () |
| static & | PUBLIC_CONTEXT () |
| static | addPermissions ($conf) |
| static | getPermissions (&$obj, $params=array()) |
| static | filterPermissions (&$obj, &$perms, $params=array()) |
| static | checkPermission ($permissionName, $perms, $params=array()) |
| static | view (&$perms, $params=array()) |
| static | edit (&$perms, $params=array()) |
| static | delete (&$perms, $params=array()) |
| static | MASK () |
| static | _zero () |
| static | _one () |
| static | NO_ACCESS () |
| static | READ_ONLY () |
| static | ALL () |
| static & | READ_EDIT () |
| static & | getRolePermissions ($roleName) |
| static | roleExists ($roleName) |
| static | namesAsArray ($permissions) |
| static | namesAsString ($permissions) |
| static | cachePermissions (&$record, $params, $perms) |
| static | getCachedPermissions (&$record, $params) |
Detailed Description
Definition at line 25 of file PermissionsTool.php.
Member Function Documentation
| static addPermissions |
( |
|
$conf | ) |
|
|
static |
Adds permissions as loaded from a configuration file. Key/Value pairs are interpreted as being permission Name/Label pairs and key/Array(key/value) are interpreted as being a role defintion.
Definition at line 120 of file PermissionsTool.php.
Reference to permissions array that has all permissions (view, edit, and delete). !! NOTE THAT THIS METHOD IS DEPRECATED AS OF VERSION 0.6 . PLEASE USE !! getRolePermissions() instead.
Definition at line 218 of file PermissionsTool.php.
| static cachePermissions |
( |
& |
$record, |
|
|
|
$params, |
|
|
|
$perms |
|
) |
| |
|
static |
| static checkPermission |
( |
|
$permissionName, |
|
|
|
$perms, |
|
|
|
$params = array() |
|
) |
| |
|
static |
Checks to see if a particular permission is granted in an object or permissions array.
- Parameters
-
| $permissionName | The name of the permission to check (one of {'view','edit','delete'}) |
| $perms | The object or permissions array to check. It this is an object it must be of type one of {Dataface_Table, Dataface_Record, or Dataface_Relationship}. |
| $params | Optional field name in the case that param #2 is a table or record. |
Definition at line 145 of file PermissionsTool.php.
| static delete |
( |
& |
$perms, |
|
|
|
$params = array() |
|
) |
| |
|
static |
Checks to see if an object or permissions array has delete permissions. !! NOTE THAT THIS METHOD IS DEPRECATED AS OF VERSION 0.6 . PLEASE USE !! getRolePermissions() instead.
- Parameters
-
| $perms | Either an object (Table or Record) or a permissions array. |
| 2 | Optional name of a field we wish to check (only if $perms is a Table or Record). |
Definition at line 180 of file PermissionsTool.php.
| static edit |
( |
& |
$perms, |
|
|
|
$params = array() |
|
) |
| |
|
static |
Checks to see if an object or permissions array has edit permissions. !! NOTE THAT THIS METHOD IS DEPRECATED AS OF VERSION 0.6 . PLEASE USE !! getRolePermissions() instead.
- Parameters
-
| $perms | Either an object (Table or Record) or a permissions array. |
| 2 | Optional name of a field we wish to check (only if $perms is a Table or Record). |
Definition at line 168 of file PermissionsTool.php.
| static filterPermissions |
( |
& |
$obj, |
|
|
& |
$perms, |
|
|
|
$params = array() |
|
) |
| |
|
static |
| static getCachedPermissions |
( |
& |
$record, |
|
|
|
$params |
|
) |
| |
|
static |
| static& getContextMask |
( |
|
$id, |
|
|
|
$fieldname = null |
|
) |
| |
|
static |
| static& getContextMasks |
( |
| ) |
|
|
static |
Gets singleton instance of permissions tool. This is to be called statically.
Definition at line 31 of file PermissionsTool.php.
| static getPermissions |
( |
& |
$obj, |
|
|
|
$params = array() |
|
) |
| |
|
static |
| static& getRolePermissions |
( |
|
$roleName | ) |
|
|
static |
Returns the permissions that are assigned to a certain role. This allows a set of permissions to be grouped together and returned by getPermissions() methods. A role is essentially just a list of permissions that are associated with the name of the role. Roles can be defined in the permissions.ini files which are located in any table configuration folder, the application folder, or the dataface folder. Try to place the roles in the appropriate folder based on what it is most closely related to. For example, if the role is specifically related to one table then place it in the permissions.ini file for that table, but if it is more general you can place it in the permissions.ini file for the application. This will allow for better modularization and re-use of useful table definitions between applications. The goal here is to allow you to distribute your tables to others so that they can be added easily to other applications. If everything relating to the table is located in one folder then this becomes much easier.
- Parameters
-
| $roleName | The name of the role. |
- Returns
- An array of permissions (the keys are the permission names, and the values are the permission labels.
Definition at line 249 of file PermissionsTool.php.
| static namesAsArray |
( |
|
$permissions | ) |
|
|
static |
Returns a list of names of granted permissions in a given permissions array.
Definition at line 263 of file PermissionsTool.php.
| static namesAsString |
( |
|
$permissions | ) |
|
|
static |
Returns comma-delimited list of names of granted permissions in a given permissions array.
Definition at line 272 of file PermissionsTool.php.
| static& PUBLIC_CONTEXT |
( |
| ) |
|
|
static |
Reference to permissions array that has read and edit access (but not delete). !! NOTE THAT THIS METHOD IS DEPRECATED AS OF VERSION 0.6 . PLEASE USE !! getRolePermissions() instead.
Definition at line 227 of file PermissionsTool.php.
Reference to permissions array that have only view permissions. !! NOTE THAT THIS METHOD IS DEPRECATED AS OF VERSION 0.6 . PLEASE USE !! getRolePermissions() instead.
Definition at line 209 of file PermissionsTool.php.
| static roleExists |
( |
|
$roleName | ) |
|
|
static |
| static setContext |
( |
|
$context | ) |
|
|
static |
| static setDelegate |
( |
|
$del | ) |
|
|
static |
| static view |
( |
& |
$perms, |
|
|
|
$params = array() |
|
) |
| |
|
static |
Checks to see if an object or permissions array has view permissions. !! NOTE THAT THIS METHOD IS DEPRECATED AS OF VERSION 0.6 . PLEASE USE !! getRolePermissions() instead.
- Parameters
-
| $perms | Either an object (Table or Record) or a permissions array. |
| 2 | Optional name of a field we wish to check (only if $perms is a Table or Record). |
Definition at line 156 of file PermissionsTool.php.
The documentation for this class was generated from the following file: