markstory/acl_extras — Issue #14: Scaffolding Addition
Author: gburnes
Created: 2012-01-16 12:49:35+00:00
State: open

Hello,

I was following the CakePHP Simple ACL tutorial and noticed a small problem. If you actually bake all the methods like to tutorial says, you will find after using your plugin that the ACL check fails for the functions you are scaffolding.

So, I added a little bit to your script to support scaffolding:

public function _checkMethods(..)
{
...

$vars = get_class_vars($className);

if( array_key_exists('scaffold', $vars) )
{
$this->out(__('Scaffolding Detected: Adding Scaffolding Actions for class '.$className));
$array = array('add', 'edit', 'view', 'index', 'delete');
$actions = array_merge($actions, $array);
}