acl_extras icon indicating copy to clipboard operation
acl_extras copied to clipboard

Scaffolding Addition

Open false-start opened this issue 14 years ago • 1 comments

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);

}

unset($array, $vars);

false-start avatar Jan 16 '12 12:01 false-start

Could you submit changes to the plugin as patches/commits on a fork? They are generally easier to apply and merge in :)

markstory avatar Jan 16 '12 17:01 markstory