From: Tony Mack Date: Mon, 9 Oct 2006 17:52:55 +0000 (+0000) Subject: - removed 'Adm' prefix X-Git-Tag: pycurl-7_13_1~639 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0aef4568db64d37dec6a08f49b076e763c8ad015;p=plcapi.git - removed 'Adm' prefix --- diff --git a/PLC/Methods/AuthCheck.py b/PLC/Methods/AuthCheck.py new file mode 100644 index 00000000..3a697eef --- /dev/null +++ b/PLC/Methods/AuthCheck.py @@ -0,0 +1,16 @@ +from PLC.Method import Method +from PLC.Parameter import Parameter, Mixed +from PLC.Auth import PasswordAuth + +class AuthCheck(Method): + """ + Returns 1 if the user authenticated successfully, faults + otherwise. + """ + + roles = ['admin', 'pi', 'user', 'tech'] + accepts = [PasswordAuth()] + returns = Parameter(int, '1 if successful') + + def call(self, auth): + return 1