Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network/node/auth.py
diff options
context:
space:
mode:
Diffstat (limited to 'sugar_network/node/auth.py')
-rw-r--r--sugar_network/node/auth.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sugar_network/node/auth.py b/sugar_network/node/auth.py
index 131cda5..a190edc 100644
--- a/sugar_network/node/auth.py
+++ b/sugar_network/node/auth.py
@@ -48,6 +48,10 @@ def _validate(request, role):
if exists(config_path):
_config.read(config_path)
- if _config.has_option(request.principal, role):
- return _config.get(request.principal, role).strip().lower() in \
+ user = request.principal
+ if not _config.has_section(user):
+ user = 'DEFAULT'
+
+ if _config.has_option(user, role):
+ return _config.get(user, role).strip().lower() in \
('true', 'on', '1', 'allow')