namespace PhpBURN\Spices\ACL; \PhpBURN::loadSpice('acl', array('1.0')); ############################################ # Create Settings ############################################ /** * ACL Spice Settings */ $aclSettings = array('defaultVisibile' => array('public'), 'defaultPermission' => 'allow', 'defaultType' => 'unknown', 'authInfo' => array('allowedMethods' => &$_SESSION[PHPBURN_SESSIONNAME]['userInfo']['allowedMethods'])); ############################################ # Define ACL configuration ############################################ PhpBURN_ACL::setConfig($aclSettings); PhpBURN_ACL_Control::generateRules(); ############################################ # callBack functions ############################################ $callBack = array('granted' => function () { return true; }, 'denied' => function () { die("Your access to this area has been denied. You've been a bad bad dog!"); }); PhpBURN_ACL::setCallBack($callBack); ############################################ # Add Controller onCallActionBefore to be # executed before each controller call ############################################ \PhpBURN_ControllerConfig::addOnCallActionBefore('phpburn_spice_acl', function ($controllerName, $action, $parms) { PhpBURN_ACL::checkPermissions($controllerName, $action, $parms); });