git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e6b8e3
)
- removed 'Adm' prefix
author
Tony Mack
<tmack@cs.princeton.edu>
Mon, 9 Oct 2006 17:52:55 +0000
(17:52 +0000)
committer
Tony 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]
patch
|
blob
diff --git a/PLC/Methods/AuthCheck.py
b/PLC/Methods/AuthCheck.py
new file mode 100644
(file)
index 0000000..
3a697ee
--- /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