Question

I am designing access control list in my system. In that there will be a tree of groups and accounts as shown below

All users
    administrators
          john
    privilege members
          Peter
          mike

In the above tree 'All users' 'administrators' ' privilege members are groups. I want to create a tree to store above info. In adjacency list traversal read operation is costly and in Mptt traversal write operations are costly. For an ACL what should be of more importance, read or write. I think read will be used frequently but want to take opinion of smart guys out here. In cake php acl they have used mptt.

Was it helpful?

Solution

In real life situations you use far more "read" operations than "write" operations. So, best thing is to go with the modified preorder tree traversal (MPTT) solution which is very elegant once you understand it. Here's a PHP class providing an implementation of the modified preorder tree traversal algorithm which is very well documented and easy to get going with. Also, on the page, you'll find links to read more about the algorithm.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top