Sascha
Sascha

Reputation: 53

Zend Framework dynamic ACL with special privileges depending on DB entries

I need to implement ACL in a ZF application (with Doctrine 2).

The goal is: When a user logs in, all his privileges should be determined an saved to memcache, to be accessible quickly throughout the session.

The problem is that there a special privileges the can't be described via module > controller > action.

e.g.

table 'user'

id  name

1   Admin

2   Peter

table 'role'

id  name

1   admin

2   user

table 'user_role'

id    user_id    role_id

1     1               1

2     2               2

table 'item'

id  owner

1   1

2   4

We have items, which only should be editable by the admin or the user who has created the item (owner). How could this be described in a privileges table ?

table 'privilege'

id  role_id …

1   2

Upvotes: 3

Views: 1167

Answers (1)

Related Questions