On Sat, Jan 12, 2013 at 04:39:45PM -0800, Chung Wu wrote:
> Hi there,
>
> I am having difficulty figuring out how to structure the following problem:
>
> Users have different roles/groups:
>
> Admin, Manager, Author
>
> Admins can edit every user, can view list of all users, delete all users
> Manager can edit all users who are not admins or managers, ""
> Author, can only edit themselves, view themselves
>
> Users are associated with Posts
>
> The posts would follow the same logc
>
> Authors can only see posts they have created, Edit them etc
>
> Is there a generic way to do this?
>
> Currently I have views that list all users, post etc but how would I
> integrate roles/permissions to filter the lists, prevent the user for
> editing others etc.
You can code that by your own, creating an app for managing permissions whose
model is related to User model. Permissions model might contain the different
types of roles and the possible actions to.
Anyway, you already have Django Guardian, as said above. It allows you to
define easily permissions for a model (adding them to *Meta* class) and assign
them for any user/group.
I�igo
>
> Hope you can point me in the right direction
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/OUSzdMwTvroJ.
> To post to this group, send email to
django...@googlegroups.com.
> To unsubscribe from this group, send email to
django-users...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>