Add 'php/phpxmlrpc/' from commit 'cd5dbb4a511e7a616a61187a5de1a611a9748cbd'
[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