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

+ 2
- 0
plugins/acl.py View File

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

Loading…
Cancel
Save