views:

52

answers:

1

I'm trying to figure out Django Groups and the documentation is pretty bare on the site.

For example, you can use the decorator permission_required() to check the permissions, however, this only checks if you have assigned permissions directly. I have assigned Users to Groups which have Permissions setup. When using Django's permissions system, it ignores the Groups the User belongs to.

Is there any way to get Django to inherit permissions from the User's Groups?

+2  A: 

Django does automatically inherit permissions from groups. There may be some problem in your installation or database (such as using a custom permission without having done a syncdb), or you might be passing the wrong argument to the decorator.

If you have a model named post in an app named blog for example, the decorator would be used like this:

@permission_required('blog.delete_post')
Van Gale
Thanks Van. I was using model.permission_name instead of the correct app.permission_name
Matt McCormick