I'm providing my own functions for determining permissions, so I store
the user, a permission and a project. I'll have to keep admins away
from the permissions page as that'll bypass project based permissions.

On Jan 28, 2:53 pm, Stodge <[email protected]> wrote:
> I thought there might be a way to store the site ID in request.session
> and then hack its value into settings.SITE_ID, but that doesn't work.
> I have to set SITE_ID = -1 in settings.py and this value is always
> loaded by the Sites framework, my hacked value is ignore. It was worth
> a try!
>
> On Jan 28, 1:15 pm, Stodge <[email protected]> wrote:
>
> > I'm prototyping ideas for a project management tool. It supports
> > multiple projects per site, but I'm not sure how to define permissions
> > on a per project basis. Currently I have:
>
> > class Project(models.Model):
>
> >         title = models.CharField(max_length=128)
> >         description = models.TextField()
> >         members = models.ManyToManyField(User, through='Membership')
>
> >         class Meta:
> >                         permissions = (
> >                                 ("is_member", "Is a member"),
> >                         )
>
> > class Membership(models.Model):
> >         user = models.ForeignKey(User)
> >         project = models.ForeignKey(Project)
> >         role = models.CharField(max_length=120)
>
> > This is fine except I want to re-use Django's permissions. But I can't
> > see how to do this as the permissions table is rebuilt when the DB is
> > resyncedd so there's no guarantee that the ID of a particular
> > permission is consistent. Or is this a non-issue? Any ideas on the
> > best way to implement this?
>
> > I also considered using the Sites feature, where a site is basically a
> > project, but I want users to be able to creates projects via the web
> > interface, so creating a new settings.py file isn't too realistic.
>
> > Comments welcome. Thanks
>
>

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

Reply via email to