Initial checkin of new API implementation
[plcapi.git] / PLC / Methods / AdmAuthCheck.py
1 from PLC.Method import Method
2 from PLC.Parameter import Parameter, Mixed
3 from PLC.Auth import PasswordAuth
4
5 class AdmAuthCheck(Method):
6     """
7     Returns 1 if the user authenticated successfully, faults
8     otherwise.
9     """
10
11     roles = ['admin', 'pi', 'user', 'tech']
12     accepts = [PasswordAuth()]
13     returns = Parameter(int, '1 if successful')
14
15     def call(self, auth):
16         return 1