Browse Source

Small bugfixes in Lodel/user.py & "acl" plugin

Yann Weber 8 years ago
parent
commit
3948e5e543
2 changed files with 3 additions and 1 deletions
  1. 1
    1
      Lodel/user.py
  2. 2
    0
      plugins/acl.py

+ 1
- 1
Lodel/user.py View File

@@ -147,7 +147,7 @@ class identification_method(object):
147 147
     @classmethod
148 148
     def identify(cls, client_infos):
149 149
         if len(cls.__methods) == 0:
150
-            raise RuntimeError("Not identification method registered")
150
+            warnings.warn("No identification methods registered")
151 151
         res = False
152 152
         for method in cls.__methods:
153 153
             ret = method(client_infos)

+ 2
- 0
plugins/acl.py View File

@@ -9,6 +9,7 @@ class PermissionDenied(Exception): pass
9 9
 def check_anon(hook_name, caller, payload):
10 10
     if not UserContext.identity().is_identified:
11 11
         raise PermissionDenied("Anonymous user's are not allowed to get content")
12
+    return payload
12 13
 
13 14
 @LodelHook('leapi_update_pre')
14 15
 @LodelHook('leapi_delete_pre')
@@ -16,3 +17,4 @@ def check_anon(hook_name, caller, payload):
16 17
 def check_auth(hook_name, caller, payload):
17 18
     if not UserContext.identity().is_authenticated:
18 19
         raise PermissionDenied("Only authenticated user's are allowed to do that !")
20
+    return payload

Loading…
Cancel
Save