phalcon Working with ACL

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • You can use '*' as second and third parameter in Phalcon\Acl::allow and Phalcon\Acl::deny methods. This will mean any resource and action respectively.
  • Second argument in Phalcon\Acl::addRole tells from which role inheritance access.

Remarks

  • You should serialize your ACL to some file or cache backend instead of creating it on each request.
  • Also it's good idea to keep acl in seperated file.
  • Phalcon\Acl is able to send events to event manager, there are two events - beforeCheckAccess and afterCheckAccess.
  • You can use Phalcon\Acl\AdapterInterface to implement your own acl adapter.
  • You can protect your routes using acl with combination of proper listener in dispatcher


Got any phalcon Question?