El 11/01/10 13:46, Tim escribió: > There is an interesting requirement in a project I am working on. For > lack of a better term, I'll call it Namespace Security. Basically, > there are arbitrary namespaces that can be defined, and every object > belongs to a namespace. Then, users only have access to certain > namespaces. So if a user has "add/change/delete course", he/she would > only be able to perform those actions on the namespace that he/she has > access to. > > Basic models would look like this. Then any additional models just add > the ForeignKey to Namespace. > > model Namespace(models.Model): > name = models.CharField() > users = models.ManyToManyField("auth.User") > > model Course(models.Model): > namespace = models.ForeignKey(Namespace) > > If a user has "add course" permission, and access to NamespaceA, he > can add a course to that namespace, but would not be able to add a > course to NamespaceB. > > The issue is getting Django admin to recognize this. Has anyone seen > or done anything like this? I have a few ideas where to begin, but > figured I would ask first so I don't end up re-inventing the wheel if > something has already been started. >
I'm facing similar requirements and came across this app: http://packages.python.org/django-authority/ but haven't tried it out yet. -- Gonzalo Delgado <gonzalo...@gmail.com>
-- 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.