diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-20 19:32:44 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2014-01-20 19:32:44 +0100 |
commit | 27c1654d4f5889ec9c634537e32018b4a52eed52 (patch) | |
tree | 9437d5a563821597cb85bb6fa14c494f08bc100f /pyload/Api.py | |
parent | fixed py 2.5 incompatibility (diff) | |
download | pyload-27c1654d4f5889ec9c634537e32018b4a52eed52.tar.xz |
fixed new waiting dl rule
Diffstat (limited to 'pyload/Api.py')
-rw-r--r-- | pyload/Api.py | 6 |
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 |