summaryrefslogtreecommitdiffstats
path: root/module/Api.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/Api.py')
-rw-r--r--module/Api.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/Api.py b/module/Api.py
index 6ef425d26..577c420c3 100644
--- a/module/Api.py
+++ b/module/Api.py
@@ -39,6 +39,7 @@ def RequirePerm(bits):
return _Dec
+# TODO: not needed anymore
# decorator to annotate user methods, these methods must have user=None kwarg.
class UserContext(object):
def __new__(cls, f, *args, **kwargs):
@@ -91,6 +92,10 @@ class Api(Iface):
def user(self):
return None #TODO return default user?
+ @property
+ def userHandle(self):
+ return self.user.primary if self.user is not None else None
+
@classmethod
def initComponents(cls):
# Allow extending the api