Building a generic OO ACL using Doctrine
I'm looking to design a doctrine-backed ACL system for my own use, although I'm struggling with some of the initial design considerations.
Right now I'm looking at making it based on classes and unique identifiers, storing them in a table as such:
Table: ACL
ResourceClass
ResourceKey
RoleClass
RoleKey
Permission
Obviously this is going to demand that I introspect on classes that are being queried to derive the correct ResourceClass values.
I'm wondering if this approach has been done before or if anyone has some advice with doing it in a bettery way. Other things like recursive relationships between Roles also confound me as I'm not sure how to recursively query to build and ACL for a Resource.
I'm not a huge fan of Zend ACL, so please no suggestions for it - I am aware of it!
Further clarifications will be made to this question as p开发者_运维知识库eople weigh in, so please bear with me! This question itself may require a few iterations! ;)
I use NestedSet for storing the ACL hierarchy and cache to speed things up.
Doctrine ORM for PHP - NestedSet
Here is a post which may be useful too:
Zend_Acl part 3: creating and storing dynamic ACLs | CodeUtopia - The blog of Jani Hartikainen
(take a look at the two previous parts as well).
精彩评论