summaryrefslogtreecommitdiffstats
path: root/module/database
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-27 16:24:03 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2011-09-27 16:24:03 +0200
commit5f8a4d25ea9034cadc8ae19a2ffab788f62cc56c (patch)
tree9d947797aafb3e9d97dbf10313c5f48f6f3d6198 /module/database
parentMerge (diff)
downloadpyload-5f8a4d25ea9034cadc8ae19a2ffab788f62cc56c.tar.xz
reworked authorization, now works on api level
Diffstat (limited to 'module/database')
-rw-r--r--module/database/UserDatabase.py22
1 files changed, 2 insertions, 20 deletions
diff --git a/module/database/UserDatabase.py b/module/database/UserDatabase.py
index f888e219e..e74399c11 100644
--- a/module/database/UserDatabase.py
+++ b/module/database/UserDatabase.py
@@ -16,29 +16,11 @@
@author: mkaay
"""
-from DatabaseBackend import DatabaseBackend
-from DatabaseBackend import style
-
from hashlib import sha1
import random
-class PERMS:
- ALL = 0 # requires no permission, but login
- ADD = 1 # can add packages
- DELETE = 2 # can delete packages
- STATUS = 4 # see and change server status
- SEE_DOWNLOADS = 16 # see queue and collector / modify downloads
- DOWNLOAD = 32 # can download from webinterface
- SETTINGS = 64 # can access settings
- ACCOUNTS = 128 # can access accounts
-
-class ROLE:
- ADMIN = 0 #admin has all permissions implicit
- USER = 1
-
-def has_permission(current, perms):
- # bytewise or perms before if needed
- return perms == (current & perms)
+from DatabaseBackend import DatabaseBackend
+from DatabaseBackend import style
class UserMethods():
@style.queue