Thank you for your answer. It is to much information for me and I am
not sure whether I understand it correctly :)

So basically you create for each application a corresponding
permission which looks something like 'use_appname'. If the user wants
to access 'appname' application, he has to have 'use_appname'
permission. And when these permissions are being created? When
starting a new application? (./manage.py startapp appname) And Django
just knows that permission named use_appname belongs to 'appname'?
It's a part of core? Sorry for my dumb question, I just don't know
much yet about how does Django work under the hood.

Btw I found also this <http://onecreativeblog.com/post/59051248/django-
login-required-middleware> which could also solve my problem. It
wouldn't be difficult to modify the code in order to add support for
groups.

On 26 led, 14:39, Brian Bouterse <bmbou...@gmail.com> wrote:
> I've used a post_save signal to create a per-object permission such as 'use
> application X'  This permission is checked at application use time.
> Here<https://github.com/bmbouter/vdi/blob/master/signals.py>is the
> code I wrote to do, I think, exactly what you want.  It is part of a
> django
> based connection broker <https://github.com/bmbouter/vdi> that manages cloud
> virtual machines to provide applications to users.
>
> Best,
> Brian
>
>
>
> On Wed, Jan 26, 2011 at 2:11 AM, tobik <tobiaspoto...@gmail.com> wrote:
> > My first question is whether it is possible to restrict access to the
> > whole application from one place. I could write @login_required over
> > every function but is there a better way?
>
> > My second question is whether it is possible to use user groups for
> > restricting applications. I want for example that only users in group
> > 'teachers' could access the 'teaching' application. I know that groups
> > are meant for something else but it would spare me a lot of time.
>
> > I've just started with Django so be patient with me :)
>
> > --
> > 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+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Brian Bouterse
> ITng Services

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to