I would recommend looking at the projects app in Pinax for a good
approach for this: 
http://github.com/pinax/pinax/blob/master/pinax/apps/projects/models.py

Basically, it uses a ManyToMany "members" field that you can add and
remove users to/from the project.  That particular example uses an
intermediary User model called ProjectMember to store extra info for
the user, but that's optional.  If you don't use an intermediary User
model, you will need to change the user_is_member method to something
like:

def user_is_member(self, user):
    return user in self.member_queryset() # where
self.member_queryset() returns self.members.all()

This approach will give you per-project permissions like you
requested.

On Oct 5, 5:23 am, Stodge <sto...@gmail.com> wrote:
> That looks like what I need. Thanks. Though I also need per-project
> permissions; so user 'bob' can access tickets on Project A but not on
> Project B. I'll have to re-read django-todo's code when I have more
> time to see if they implement per group permissions.
>
> On Oct 4, 9:03 pm, Mike Dewhirst <mi...@dewhirst.com.au> wrote:
>
>
>
> > On 5/10/2010 11:32am, Stodge wrote:
>
> > >   What's the best way to implement project permissions in a project
> > > management app? Should I just create the concept of membership and
> > > have a function is_member on the project model?
>
> > Have a look at django-todo. A quick read the other day indicated to me
> > that it has what you are looking for. I'm planning to look more closely
> > but haven't had time yet.
>
> > 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to