Zend framework authentication and acl question
After successfull login/authentication can i allow/deny some action ?
Is there any allow/deny functio开发者_JS百科n with zend authentication ?
Or do i have to allow/deny with only zend acl ?
And how can i create resouce with actions ?
Zend_Auth handles authentication, and does not provide any authorization facilities. This is good. Auth will answer the question "is the user authenticated", via hasIdentity(), or "who is the user" via getIdentity().
It will not answer questions like "is the user allowed to access FooController", or "is this user allowed to update this particular Widget object". If you want to do that sort of thing, you use Zend_Acl, or some other authorization scheme.
If you just want to allow/deny for logged in/not logged in, you obviously don't need ACL. You just check for authentication. If user is not authenticated, reroute with a flash message. If you need different user groups, you will want to use ACL because that's what this component is made for.
精彩评论