We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

ACL for multimodule (same controller names)

Hello,

I've been trying to add ACL to a two-module app where controllers of the same names exist.

Someone mentioned that you could use 'moduleName:controllerName' as the resource, but it doesn't work.

Is there a way for this to work now in v3.4, or should I name the controllers differently?

Thanks



1.3k

For now, I found that a separate ACL for each module works. Perhaps it can perform better, too.

I see that perhaps in v4.0 the dispatcher can forward to module. In 3.4 this doesn't work.

My acl works with module : controller

Check resource with module:controller

$this->_acl->isAllowed($user['profile_id'], $dispatcher->getModuleName() . ':' . $controller, $action)

Add resource module:controller

$this->addResource($module . ':' . $$controller, $actionList);