Merge remote-tracking branch 'origin/pycurl' into planetlab-4_0-branch
[plcapi.git] / PLC / Methods / AuthCheck.py
1 from PLC.Method import Method
2 from PLC.Parameter import Parameter, Mixed
3 from PLC.Auth import Auth, BootAuth
4
5 class AuthCheck(Method):
6     """
7     Returns 1 if the user or node authenticated successfully, faults
8     otherwise.
9     """
10
11     roles = ['admin', 'pi', 'user', 'tech', 'node']
12     accepts = [Auth()]
13     returns = Parameter(int, '1 if successful')
14
15     def call(self, auth):
16         return 1