Each controller in CakePHP has various methods that are called.
These methods are recorded in a config file with the convention Rba + contoller name + .php.
Refer to the RbaPermanentUsers.php here:
<?php
$config = [];
$config['RbaPermanentUsers'] = [
'admin' => ['*'],
'view' => [
'exportCsv',
'index',
//'add',
//'import',
//'delete',
'viewBasicInfo',
//'editBasicInfo',
'viewPersonalInfo',
//'editPersonalInfo',
'privateAttrIndex',
//'privateAttrAdd',
//'privateAttrEdit',
//'privateAttrDelete',
//'restrictListOfDevices',
//'autoMacOnOff',
'viewPassword',
//'changePassword',
//'emailUserDetails',
'enableDisable',
//Buttons
//'btnRadius',
//'btnGraph',
//'btnByod',
//'btnTopup',
],
'granular' => [
'exportCsv',
'index',
'add',
'import',
'delete',
'viewBasicInfo',
'editBasicInfo',
'viewPersonalInfo',
'editPersonalInfo',
'privateAttrIndex',
'privateAttrAdd',
'privateAttrEdit',
'privateAttrDelete',
'restrictListOfDevices',
'autoMacOnOff',
'viewPassword',
'changePassword',
'emailUserDetails',
'enableDisable',
//Buttons
'btnRadius',
'btnGraph',
'btnByod',
'btnTopup',
],
'logActions' => true, //Flag to set if we want to actions logged
'logExcludes' => [
'index'
]
];
return $config;
?>
The file returns an array called $config with a key that matches the filename without .php.
In our sample it is RbaPermanentUsers.
The value of this key in turn contains an array with the following keys:
admin: Typically contains a wildcard array.
view: Contains an array with all the methods / actions in the controller you want to apply RBA to. Some might be commented out to show they are not available to the view role.
granular: Contains an array with all the methods / actions in the controller you want to apply RBA to. Some might be commented out to show they are not available to the operator role.
logActions: Specify if actions on this controller needs to be recorded in a log.
logExcludes: Specify which actions should be excluded from the log records.