summaryrefslogtreecommitdiffstats
path: root/pyload/api/UserApi.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/api/UserApi.py')
-rw-r--r--pyload/api/UserApi.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/pyload/api/UserApi.py b/pyload/api/UserApi.py
new file mode 100644
index 000000000..250b9080c
--- /dev/null
+++ b/pyload/api/UserApi.py
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from pyload.Api import Api, RequirePerm, Permission
+
+from ApiComponent import ApiComponent
+
+
+class UserApi(ApiComponent):
+ """ Api methods to retrieve user profile and manage users. """
+
+ @RequirePerm(Permission.All)
+ def getUserData(self):
+ """ Retrieves :class:`UserData` for the currently logged in user. """
+
+ @RequirePerm(Permission.All)
+ def setPassword(self, username, old_password, new_password):
+ """ Changes password for specific user. User can only change their password.
+ Admins can change every password! """
+
+ def getAllUserData(self):
+ """ Retrieves :class:`UserData` of all exisitng users."""
+
+ def addUser(self, username, password):
+ """ Adds an user to the db.
+ :param username: desired username
+ :param password: password for authentication
+ """
+
+ def updateUserData(self, data):
+ """ Change parameters of user account. """
+
+ def removeUser(self, uid):
+ """ Removes user from the db.
+
+ :param uid: users uid
+ """
+
+
+if Api.extend(UserApi):
+ del UserApi \ No newline at end of file