- removed 'Adm' prefix
authorTony Mack <tmack@cs.princeton.edu>
Mon, 9 Oct 2006 17:52:55 +0000 (17:52 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 9 Oct 2006 17:52:55 +0000 (17:52 +0000)
PLC/Methods/AuthCheck.py [new file with mode: 0644]

diff --git a/PLC/Methods/AuthCheck.py b/PLC/Methods/AuthCheck.py
new file mode 100644 (file)
index 0000000..3a697ee
--- /dev/null
@@ -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