systers/portal — pull request #37 by ana-balica (2014-07-15 19:36:48+00:00)
Title: Object level permissions

### Includes:

* [django-guardian](http://django-guardian.readthedocs.org/) for object-level permissions
* new community permissions
* removal of creating generic groups, now for every community 4 new groups are created
* catching of `post_save` and `post_delete` signals to create community groups and assign permissions to each group
* unittests

### How it works:

1. Create a new community object called “Foo”
2. On saving new community “Foo” create groups:
* “Foo Content Contributor”
* “Foo Content Manager”
* “Foo User and Content Manager”
* “Foo Community Admin”
3. For each newly created group assign permissions - assign_perm('some_permission', group_name, community_foo)
4. If you want to give "Content Contributor" permissions to this community to a specific user, make user member of the “Foo Content Contributor”
5. In views check if user has permissions inside functions or using decorators

This is how it looks like in the admin dashboard
![screenshot from 2014-07-15 13 13 36](https://cloud.githubusercontent.com/assets/2039122/3590276/1d1340b4-0c57-11e4-9e66-21d9b180ab4a.png)

More details and discussions here - https://docs.google.com/document/d/14Xw-Xb82tXDdIki7-ZgppoUbwQ6DpmBP9fEiBm8zvLQ