diff options
author | 2013-10-04 18:54:40 +0200 | |
---|---|---|
committer | 2013-10-04 18:54:40 +0200 | |
commit | 60c64d85ce6078c9b0a66b9808943fa60b3eb819 (patch) | |
tree | a0b208d4bfa4bf3e3f30a3d657667b58d1f4a449 /pyload/Api.py | |
parent | update underscore.js version (diff) | |
download | pyload-60c64d85ce6078c9b0a66b9808943fa60b3eb819.tar.xz |
stubs for Api to manage users.
Diffstat (limited to 'pyload/Api.py')
-rw-r--r-- | pyload/Api.py | 27 |
1 files changed, 2 insertions, 25 deletions
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 """ |