Friday 15 June 2012

How to restrict certain rows in a Django model to a department? -



How to restrict certain rows in a Django model to a department? -

this looks should easy can't find it.

i'm creating application want give admin site access people different departments. people read , write same tables, must only access rows belonging department! i.e. must not see records produced other departments , should able modify records own department. if create record, should automatically "belong" section of user created (they create records admin site).

i've found django-guardian, looks overkill - don't want have arbitrary per-record permissions.

also, number of records potentially large, kind of front-end permission checking on per-record basis not suitable - must done db-side filtering. other that, i'm not particular how done. e.g. i'm fine mapping departments auth groups.

django django-admin

No comments:

Post a Comment