class PermissionsManager

Class PermissionsManager manages updating permissions, removing and additional admin functions

Properties

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

Methods

__construct(FileManager $ConfigFileManager, Framework $Framework)

Construct a new permission manager

array
createRules()

Create rules for a new permission

array
updateRules()

Create rules to edit a permission

bool
storePermission(array $input)

Validates and updates a permission with the given input

bool
updatePermission($input)

Validates and updates a permission with the given input

boolean
destroyPermission(string $condition)

Destroys a permission by retrieving current config contents and unsetting the key (condition) then saving the updated contents

Details

at line 43
__construct(FileManager $ConfigFileManager, Framework $Framework)

Construct a new permission manager

Parameters

FileManager $ConfigFileManager
Framework $Framework

at line 68
array createRules()

Create rules for a new permission

Return Value

array

at line 80
array updateRules()

Create rules to edit a permission

Return Value

array

at line 93
bool storePermission(array $input)

Validates and updates a permission with the given input

Parameters

array $input

Return Value

bool | array

at line 126
bool updatePermission($input)

Validates and updates a permission with the given input

Parameters

$input

Return Value

bool

at line 163
boolean destroyPermission(string $condition)

Destroys a permission by retrieving current config contents and unsetting the key (condition) then saving the updated contents

Parameters

string $condition

Return Value

boolean | array