2010年3月15日星期一

Re: [fw-auth] Re: ACL... but completely different

I have this exact example on my blog:

http://ralphschindler.com/2009/08/13/dynamic-assertions-for-zend_acl-in-zf

Hopefully that might give you some insight on how-to integration
Zend_Acl into your models.

The other advice in this thread is sound as well (gathering the
information statically from some kind of globally accessible place.)

hope that helps,
-ralph

Laura Dean wrote:
> I must be missing something with the assertions. The example given was just
> testing an IP address which can be determined by a global variable, but if I
> need to test if the user owns the blog post, surely I must pass in the user
> id and the id of the blog post? Is there some way to pass parameters to the
> assertions? I was thinking something like this would be convenient:
>
> $acl->isAllowed('role', 'resource', 'privilege', $params);
>
> Or am I supposed to extend Zend_Acl_Resource so that I can set the id here?

没有评论: