From 60c64d85ce6078c9b0a66b9808943fa60b3eb819 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Fri, 4 Oct 2013 18:54:40 +0200 Subject: stubs for Api to manage users. --- pyload/Api.py | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'pyload/Api.py') diff --git a/pyload/Api.py b/pyload/Api.py index 32a077c08..81e39d82d 100644 --- a/pyload/Api.py +++ b/pyload/Api.py @@ -128,8 +128,6 @@ class Api(Iface): # Auth+User Information ############################# - # TODO - @RequirePerm(Permission.All) def login(self, username, password, remoteip=None): """Login into pyLoad, this **must** be called when using rpc before any methods can be used. @@ -153,7 +151,8 @@ class Api(Iface): return self.core.db.checkAuth(username, password) - def isAuthorized(self, func, user): + @staticmethod + def isAuthorized(func, user): """checks if the user is authorized for specific method :param func: function name @@ -167,28 +166,6 @@ class Api(Iface): else: return False - # TODO - @RequirePerm(Permission.All) - def getUserData(self, username, password): - """similar to `checkAuth` but returns UserData thrift type """ - user = self.checkAuth(username, password) - if not user: - raise UserDoesNotExists(username) - - return user.toUserData() - - def getAllUserData(self): - """returns all known user and info""" - return self.core.db.getAllUserData() - - def changePassword(self, username, oldpw, newpw): - """ changes password for specific user """ - return self.core.db.changePassword(username, oldpw, newpw) - - def setUserPermission(self, user, permission, role): - self.core.db.setPermission(user, permission) - self.core.db.setRole(user, role) - class UserApi(Api): """ Proxy object for api that provides all methods in user context """ -- cgit v1.2.3