From: Thierry Parmentelat Date: Tue, 7 Dec 2010 15:25:13 +0000 (+0100) Subject: Merge branch 'master' of ssh://git.onelab.eu/git/plcapi X-Git-Tag: plcapi-5.0-23~1 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=35fbb0b42f864cff0ae56b36a9f53155d9aca2e3;hp=79804af429d6b019b8427372213f733684c6981a;p=plcapi.git Merge branch 'master' of ssh://git.onelab.eu/git/plcapi --- diff --git a/PLC/Auth.py b/PLC/Auth.py index b519b1bf..50e8b8e3 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -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 diff --git a/PLC/Methods/AuthCheck.py b/PLC/Methods/AuthCheck.py index 4cea8d88..0a4c2601 100644 --- a/PLC/Methods/AuthCheck.py +++ b/PLC/Methods/AuthCheck.py @@ -1,5 +1,3 @@ -# $Id$ -# $URL$ from PLC.Method import Method from PLC.Parameter import Parameter, Mixed from PLC.Auth import Auth, BootAuth diff --git a/PLC/Methods/GetInterfaceTags.py b/PLC/Methods/GetInterfaceTags.py index 131d3e52..8117ccaf 100644 --- a/PLC/Methods/GetInterfaceTags.py +++ b/PLC/Methods/GetInterfaceTags.py @@ -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(), diff --git a/PLC/Methods/GetNodeTags.py b/PLC/Methods/GetNodeTags.py index 41dfd8b9..3ae9fd6d 100644 --- a/PLC/Methods/GetNodeTags.py +++ b/PLC/Methods/GetNodeTags.py @@ -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(),