acl icon indicating copy to clipboard operation
acl copied to clipboard

Extend AclExtras sync in a plugin

Open Wouter0100 opened this issue 10 years ago • 2 comments

I'm implementing CakePHP/Acl with the FriendsOfCake/Crud plugin, and after sync'ing all acos, none of the Crud actions appeard in the Acos table. This is because these actions aren't really methods, which isn't detected by AclExtras.

I think it would be a good idea to make it possible for plugins to extend or receive an event to add/manipulete there own actions/methods on a sync. Any ideas/comments?

Wouter0100 avatar Nov 04 '15 14:11 Wouter0100

I've gotten around this by adding:

public function add()
{
    return $this->Crud->execute();
}

to my Crud controllers. I do agree, that the ability for plugins to inject their own actions would be fantastic.

dakota avatar Nov 04 '15 14:11 dakota

Ah, indeed. That's a workaround, I added these 4 methods to my AppController just for creating them. Now they are added to my Acos table, thanks :smile:.

I've also experienced some issues with (custom) Traits methods, which are synced. This could also be fixed with a fix for this issue.

Wouter0100 avatar Nov 04 '15 15:11 Wouter0100