summaryrefslogtreecommitdiffstats
path: root/pyload/Api.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-20 19:32:44 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2014-01-20 19:32:44 +0100
commit27c1654d4f5889ec9c634537e32018b4a52eed52 (patch)
tree9437d5a563821597cb85bb6fa14c494f08bc100f /pyload/Api.py
parentfixed py 2.5 incompatibility (diff)
downloadpyload-27c1654d4f5889ec9c634537e32018b4a52eed52.tar.xz
fixed new waiting dl rule
Diffstat (limited to 'pyload/Api.py')
-rw-r--r--pyload/Api.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pyload/Api.py b/pyload/Api.py
index e6bd74a02..c1b16ad96 100644
--- a/pyload/Api.py
+++ b/pyload/Api.py
@@ -81,6 +81,12 @@ class Api(Iface):
def primaryUID(self):
return self.user.primary if self.user else None
+
+ def hasAccess(self, obj):
+ """ Helper method to determine if a user has access to a resource.
+ Works for obj that provides .owner attribute. Core admin has always access."""
+ return self.user is None or self.user.hasAccess(obj)
+
@classmethod
def initComponents(cls):
# Allow extending the api