Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchristie committed Jan 17, 2012
1 parent ce789f4 commit 3301777
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 98 deletions.
95 changes: 0 additions & 95 deletions README (Autosaved)

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
Django User Roles
=================

Simple role-based user permissions and profiles for Django.
Simple role-based user permissions for Django.

django-user-roles is a simple, reusable app that allows you to create a set of user roles, which can be used to control which views each type of user has permission to view, and to customize how the site is presented to different types of user.

<!--
User roles can also be associated with differing profile classes, allowing you to store different types of user information for different user types.
-->

Settings
--------
Expand Down Expand Up @@ -77,7 +79,7 @@ You can do this by setting `USER_ROLE_CLASS` in your settings file.
def CustomUserRole(userroles.UserRole):
@property
def can_moderate_discussions(self):
return self in (roles.manager, roles.moderator)
return self.is_moderator or self.is_manager

`views.py`:

Expand Down
2 changes: 1 addition & 1 deletion userroles/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_get_disallowed_view(self):
class CustomUserRole(UserRole):
@property
def can_moderate_discussions(self):
return self in (roles.moderator, roles.manager)
return self.is_moderator or self.is_manager


class UserRoleClassSettingTests(TestCase):
Expand Down

0 comments on commit 3301777

Please sign in to comment.