aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2013-06-11 18:21:51 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2013-06-12 14:20:17 +0300
commit67c16a4666a6a50cdbe701b4a14c4bf42311f68a (patch)
tree6356bef97391361a6106d752a09daa52bf7ab44d
parentc4ea445f0db4dd93e282d4e6f705ecde68e29327 (diff)
Not only set, but also reset staff/superuser flags. Also, don't mix them.
-rw-r--r--README.md2
-rw-r--r--crowdrest/backend.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/README.md b/README.md
index 9d21c5a..fceef94 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,8 @@ How to use it
_Django user will get superuser flag when Crowd user is in given Crowd group_
AUTH_CROWD_SUPERUSER_GROUP = 'superuser'
+ Note that superuser group member does not imply staff membership and vice
+ versa (make sure you read Django docs to understand the difference).
_crowdrest will use this username and password to connect to Crowd server_
diff --git a/crowdrest/backend.py b/crowdrest/backend.py
index ac01f89..7600906 100644
--- a/crowdrest/backend.py
+++ b/crowdrest/backend.py
@@ -114,10 +114,13 @@ class CrowdRestBackend(object):
user.groups = group_objs
if crowd_settings.AUTH_CROWD_SUPERUSER_GROUP in group_names:
- user.is_staff = True
user.is_superuser = True
+ else:
+ user.is_superuser = False
if crowd_settings.AUTH_CROWD_STAFF_GROUP in group_names:
user.is_staff = True
+ else:
+ user.is_staff = False
def get_user(self, user_id):
"Return User instance of given identifier."