summaryrefslogtreecommitdiffstats
path: root/module/Api.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/Api.py')
-rw-r--r--module/Api.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/module/Api.py b/module/Api.py
index 27d3e8ffe..bfeeff10c 100644
--- a/module/Api.py
+++ b/module/Api.py
@@ -21,8 +21,6 @@ from types import MethodType
from remote.apitypes import *
-from utils import bits_set, primary_uid
-
# contains function names mapped to their permissions
# unlisted functions are for admins only
perm_map = {}
@@ -36,7 +34,6 @@ def RequirePerm(bits):
return _Dec
-
urlmatcher = re.compile(r"((https?|ftps?|xdcc|sftp):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+\-=\\\.&]*)", re.IGNORECASE)
stateMap = {
@@ -52,10 +49,6 @@ stateMap[DownloadState.Unfinished] = frozenset(stateMap[DownloadState.All].diffe
def state_string(state):
return ",".join(str(x) for x in stateMap[state])
-
-def has_permission(userPermission, Permission):
- return bits_set(Permission, userPermission)
-
from datatypes.User import User
class Api(Iface):
@@ -85,7 +78,7 @@ class Api(Iface):
@property
def primaryUID(self):
- return primary_uid(self.user)
+ return self.user.primary if self.user else None
@classmethod
def initComponents(cls):