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