aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/api/common.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-04-23 10:04:23 +0200
committerCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-04-23 10:04:23 +0200
commitfad13d6f3a5ddb133b5dbb6df77ca200be9ea241 (patch)
tree52db75138eee48708aef3633d862938d01de0218 /pyaggr3g470r/views/api/common.py
parentFixed strange behaviour of the search when only searching on the content. (diff)
parentenforcing better user of user_id in controllers (diff)
downloadnewspipe-fad13d6f3a5ddb133b5dbb6df77ca200be9ea241.tar.gz
newspipe-fad13d6f3a5ddb133b5dbb6df77ca200be9ea241.tar.bz2
newspipe-fad13d6f3a5ddb133b5dbb6df77ca200be9ea241.zip
Merged in jaesivsm/pyaggr3g470r (pull request #12)
enforcing better user of user_id in controllers
Diffstat (limited to 'pyaggr3g470r/views/api/common.py')
-rw-r--r--pyaggr3g470r/views/api/common.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pyaggr3g470r/views/api/common.py b/pyaggr3g470r/views/api/common.py
index ca344c04..b8c4dd9d 100644
--- a/pyaggr3g470r/views/api/common.py
+++ b/pyaggr3g470r/views/api/common.py
@@ -90,6 +90,12 @@ class PyAggAbstractResource(Resource):
def controller(self):
return self.controller_cls(getattr(g.user, 'id', None))
+ @property
+ def wider_controller(self):
+ if g.user.is_admin():
+ return self.controller_cls()
+ return self.controller_cls(getattr(g.user, 'id', None))
+
def reqparse_args(self, req=None, strict=False, default=True, args=None):
"""
strict: bool
bgstack15