from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Filter import Filter
+from PLC.Persons import Person, Persons
from PLC.Keys import Key, Keys
from PLC.Auth import Auth
keys.
"""
- roles = ['admin', 'pi', 'user', 'tech']
+ roles = ['admin', 'pi', 'user', 'tech', 'node']
accepts = [
Auth(),
keys = Keys(self.api, key_filter, return_fields)
# If we are not admin, make sure to only return our own keys
- if 'admin' not in self.caller['roles']:
+ if isinstance(self.caller, Person) and \
+ 'admin' not in self.caller['roles']:
keys = filter(lambda key: key['key_id'] in self.caller['key_ids'], keys)
return keys