From 829bb6886778fc035dc5c0cb01e593e8dd317e4f Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Wed, 03 Oct 2012 06:29:18 +0000 Subject: Simple roles info for Hub --- diff --git a/sugar_network/node/commands.py b/sugar_network/node/commands.py index e576d2b..80f487a 100644 --- a/sugar_network/node/commands.py +++ b/sugar_network/node/commands.py @@ -192,6 +192,14 @@ class MasterCommands(NodeCommands, SyncCommands): directory = self.volume[document] directory.merge(guid, request.content) + @ad.volume_command(method='GET', cmd='whoami', + mime_type='application/json') + def whoami(self, request): + roles = [] + if auth.try_validate(request, 'root'): + roles.append('root') + return {'roles': roles} + def _load_pubkey(pubkey): pubkey = pubkey.strip() -- cgit v0.9.1