PHP Class Devise\Users\Permissions\PermissionsManager

Show file Open project: devisephp/cms

Public Properties

Property Type Description
$errors array Errors are kept in an array and can be used later if validation fails and we want to know why
$message string This is a message that we can store why the validation failed
$messages Validation messages

Protected Properties

Property Type Description
$ConfigFileManager

Public Methods

Method Description
__construct ( FileManager $ConfigFileManager, Framework $Framework ) Construct a new permission manager
createRules ( ) : array Create rules for a new permission
destroyPermission ( string $condition ) : boolean | array Destroys a permission by retrieving current config contents and unsetting the key (condition) then saving the updated contents
storePermission ( array $input ) : boolean | array Validates and updates a permission with the given input
updatePermission ( array $input ) : boolean Validates and updates a permission with the given input
updateRules ( ) : array Create rules to edit a permission

Protected Methods

Method Description
cleanInput ( array &$input ) : void Recursively walks the data received from the form and cleans all duplicate fields and empty values
includeRedirect ( array $input, array &$permission ) : void Recursively walks the data received from the form and cleans all duplicate fields and empty values

Method Details

__construct() public method

Construct a new permission manager
public __construct ( FileManager $ConfigFileManager, Framework $Framework )
$ConfigFileManager Devise\Support\Config\FileManager
$Framework Devise\Support\Framework

cleanInput() protected method

Recursively walks the data received from the form and cleans all duplicate fields and empty values
protected cleanInput ( array &$input ) : void
$input array
return void

createRules() public method

Create rules for a new permission
public createRules ( ) : array
return array

destroyPermission() public method

Destroys a permission by retrieving current config contents and unsetting the key (condition) then saving the updated contents
public destroyPermission ( string $condition ) : boolean | array
$condition string
return boolean | array | array

includeRedirect() protected method

Recursively walks the data received from the form and cleans all duplicate fields and empty values
protected includeRedirect ( array $input, array &$permission ) : void
$input array
$permission array
return void

storePermission() public method

Validates and updates a permission with the given input
public storePermission ( array $input ) : boolean | array
$input array
return boolean | array | array

updatePermission() public method

Validates and updates a permission with the given input
public updatePermission ( array $input ) : boolean
$input array
return boolean

updateRules() public method

Create rules to edit a permission
public updateRules ( ) : array
return array

Property Details

$ConfigFileManager protected property

protected $ConfigFileManager

$errors public property

Errors are kept in an array and can be used later if validation fails and we want to know why
public array $errors
return array

$message public property

This is a message that we can store why the validation failed
public string $message
return string

$messages public property

Validation messages
public $messages