Saturday, February 4, 2012

Re: auth groups puzzle

I've solved this problem in an app, but not with the built-in
permissions system. Instead, I created a DB structure that links
users to companies and stores the r/w status for each.

On Feb 3, 12:58 am, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
> I want to use the built-in auth_groups permissions system in a
> many-to-many sense but can't quite figure it out for my use case. Any
> help will be appreciated.
>
> The use case is: users have different types of access (r/o, r/w or
> admin) to different companies. Any single user can have r/o access to
> company-1, r/w access to company-2 and admin access to company-3 and so
> on. Any company can have relationships with many users each of whom will
> have one of the r/o, r/w or admin group permissions.
>
> So there has to be a many-to-many relationship between user and company
> and the group needs to be specified in that relationship table rather
> than in the auth_user_groups table - where it currently sits.
>
> How do I invoke a different set of permissions depending on the name of
> the group established in the user-company relationship table when a user
> is accessing that company's data?
>
> A side question is how do I remove the displayed Groups in the Django
> Admin auth/user display?
>
> Thanks
>
> Mike

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate