Merge branch 'master' of ssh://git.onelab.eu/git/plcapi
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 7 Dec 2010 15:25:13 +0000 (16:25 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 7 Dec 2010 15:25:13 +0000 (16:25 +0100)
PLC/Auth.py
PLC/Methods/AuthCheck.py
PLC/Methods/GetInterfaceTags.py
PLC/Methods/GetNodeTags.py

index b519b1b..50e8b8e 100644 (file)
@@ -139,12 +139,12 @@ class SessionAuth(Auth):
             elif session['person_id'] is not None and session['expires'] > time.time():
                 persons = Persons(method.api, {'person_id': session['person_id'], 'enabled': True, 'peer_id': None})
                 if not persons:
-                    raise PLCAuthenticationFailure, "SessionAuth: No such account"
+                    raise PLCAuthenticationFailure, "SessionAuth: No such enabled account"
                 person = persons[0]
 
                 if not set(person['roles']).intersection(method.roles):
                     method_message="method %s has roles [%s]"%(method.name,','.join(method.roles))
-                    person_message="caller has roles [%s]"%','.join(person['roles'])
+                    person_message="caller %s has roles [%s]"%(person['email'],','.join(person['roles']))
                     # not PLCAuthenticationFailure b/c that would end the session..
                     raise PLCPermissionDenied, "SessionAuth: missing role, %s -- %s"%(method_message,person_message)
 
@@ -328,7 +328,7 @@ class PasswordAuth(Auth):
 
         if not set(person['roles']).intersection(method.roles):
             method_message="method %s has roles [%s]"%(method.name,','.join(method.roles))
-            person_message="caller has roles [%s]"%','.join(person['roles'])
+            person_message="caller %s has roles [%s]"%(person['email'],','.join(person['roles']))
             raise PLCAuthenticationFailure, "PasswordAuth: missing role, %s -- %s"%(method_message,person_message)
 
         method.caller = person
index 4cea8d8..0a4c260 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-# $URL$
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
 from PLC.Auth import Auth, BootAuth
index 131d3e5..8117cca 100644 (file)
@@ -1,10 +1,6 @@
-# $Id$
-# $URL$
 #
 # Thierry Parmentelat - INRIA
 #
-# $Revision$
-#
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -26,7 +22,7 @@ class GetInterfaceTags(Method):
     the specified details will be returned.
     """
 
-    roles = ['admin', 'pi', 'user', 'node']
+    roles = ['admin', 'pi', 'user', 'tech', 'node']
 
     accepts = [
         Auth(),
index 41dfd8b..3ae9fd6 100644 (file)
@@ -1,10 +1,6 @@
-# $Id$
-# $URL$
 #
 # Thierry Parmentelat - INRIA
 #
-# $Revision: 9423 $
-#
 from PLC.Faults import *
 from PLC.Method import Method
 from PLC.Parameter import Parameter, Mixed
@@ -26,7 +22,7 @@ class GetNodeTags(Method):
     the specified details will be returned.
     """
 
-    roles = ['admin', 'pi', 'user', 'node']
+    roles = ['admin', 'pi', 'user', 'tech', 'node']
 
     accepts = [
         Auth(),