I am making a social website using Zend. The site allows users to become friends and access each other’s profiles and blogs. I also want users to have control over their privacy, which can take parameters “Friends Only” and “Public”. I looked at Zend_Acl but it seems to be only able to to handle single user’s accessibility not users have relationship. Any ideas about the best way to do this?
Share
For your purposes, if you use
Zend_Acl, you should look at assertions.Given the complex nature of the relationships between users in your applications, most of the access rules you will query seem very dynamic so they will largely rely on assertions that can use more complex logic to determine accessibility.
You should be able to accomplish what you want using
Zend_Aclthough.You may set up an ACL rule like this:
The ACL assertion itself:
Now with this assertion in place, the access will be denied if the 2 user IDs are not friends.
Check it like:
Hope that helps.