ModulePermissionsFormUtil Class Reference

Static Public Member Functions

static makeFormFromPermissionsData ($data)
static setPermissionsFromCastedPost (array $validatedAndCastedPostData, $permitable)
static typeCastPostData ($postData)

Static Protected Member Functions

static getModuleClassNameFromPostConcatenatedIndexString ($string)
static getPermissionFromPostConcatenatedIndexString ($string)
static AddorRemoveSpecificPermission ($moduleClassName, $permitable, $permission, $value)

Detailed Description

Helper class to make a ModulePermissionsForm and populate the data attribute.

Definition at line 41 of file ModulePermissionsFormUtil.php.


Member Function Documentation

static makeFormFromPermissionsData ( data  )  [static]
Parameters:
$modulesPermissionsData - combined array of all permission and existing permissions on a permittable. Organized by module. Example below showing just the accounts module:

            <?php
                $modulePermissionsData = array(
                    'accounts' => array(
                        'CREATE' => array(
                            'explicit'    => null,
                            'inherited'   => null,
                        ),
                        'CHANGE_OWNER' => array(
                            'explicit'    => null,
                            'inherited'   => null,
                        ),
                        'CHANGE_PERMISSIONS' => array(
                            'explicit'    => null,
                            'inherited'   => null,
                        ),
                        'DELETE' => array(
                            'explicit'    => null,
                            'inherited'   => null,
                        ),
                        'READ' => array(
                            'explicit'    => null,
                            'inherited'   => Permission::ALLOW,
                        ),
                        'WRITE' => array(
                            'explicit'    => null,
                            'inherited'   => Permission::DENY,
                        ),
                    ),
                );
            ?>

Definition at line 80 of file ModulePermissionsFormUtil.php.

static setPermissionsFromCastedPost ( array $  validatedAndCastedPostData,
permitable 
) [static]

Set Module Permissions from Post

Returns:
boolean - true on success

Definition at line 92 of file ModulePermissionsFormUtil.php.

static getModuleClassNameFromPostConcatenatedIndexString ( string  )  [static, protected]
Returns:
$moduleClassName string

Definition at line 112 of file ModulePermissionsFormUtil.php.

static getPermissionFromPostConcatenatedIndexString ( string  )  [static, protected]
Returns:
intval permission

Definition at line 123 of file ModulePermissionsFormUtil.php.

static typeCastPostData ( postData  )  [static]

Used to properly type cast incoming POST data

Definition at line 163 of file ModulePermissionsFormUtil.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Sun May 28 07:10:28 2017