How to organize and manage an ACL?

你。 提交于 2019-12-06 06:10:01

You could store the roles in a database and cache the object in memory using memcache so that you'd only have to query the db when new roles are added or changed. As far as implementing the ACL, since it'll be used system-wide, you can initialize it in your Bootstrap.php file and then store the object in Zend_Registry so that it is accessible to your whole app.

Applying these rules can happen at various points. You may want to apply the routes in a custom router or perhaps at a higher level at the controller level. If you extend Zend_Controller_Action, you can put your ACL rules in this master controller from which every other controller is derived. You can check ACL permissions in the _init() method. There maybe other points in the system where you need the ACL or would want to check it, depending on what and how you're building it (that's why you're storing the ACL in the registry).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!