zend_acl:动态添加额外资源并获取参数预调度
首先对华夫饼感到抱歉,因为我不知道如何最好地描述它。基本上我不确定如何在加载控制器之前在引导程序中获取参数,但这是冗长的版本...
我有一个 acl 类存储我所有的默认资源。我的所有页面/帖子内容都是数据库,我希望管理员能够选择页面可用的角色。
我知道可以循环遍历数据库表并将它们一次性添加到其中,但我担心这会消耗资源。我让它工作,我的访问检查插件可以调用动态权限函数,但我需要获取当前页面 ID 的参数以及在加载控制器之前设置它的权限。
这是有道理的还是我什么都不担心,我应该立即获取所有页面的资源?
预先感谢您阅读我的乱码!
First sorry about the woffle as I'm not sure how best to describe this. Basically I am not sure how I can get param in the bootstrap before the controller is loaded, but here is the long winded version...
I have got an acl class storing all my default resources in. All my page/post content is a database and I want the admin the ability to choose who which role the page would become available.
I know it is possible just to loop through the database table and add them all in at once, but I am concerned that this is a drain on resources. I have it working whereby my access check plugin can call a dynamic permission function, but I need to get the parameter of the current page ID and it's permission to set it before the controller is loaded.
Does that make sense or am I worry over nothing and I should just get the resources of all the pages at once?
thanks in advance for reading my garble!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过实际阅读 zend 手册,我实际上已经找到了我需要的东西!卫生部!
我只需要使用 $request->getParams() 这将允许我从 url 获取帖子 id
然后我可以使用以下方法设置权限
下面进入访问检查插件
然后在 Acl 类中
I've actually managed to find out what I need by actually reading the zend manual! DOH!
I simply needed to use to the $request->getParams() which would allow me to get post id from the url
Then I could set the permission with the following method
Below goes in the access check pluging
And then this in the Acl class