diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-18 11:50:20 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-24 12:06:09 +0200 |
commit | 49be6089b2354a71372dfaf71612de08d67986ff (patch) | |
tree | a3289c874c9bc0ebe0a7d2674ad770aa75e75c6d /ishtar_common/backend.py | |
parent | 693d7cb53d4b4f13699c4b07dd1bb8a9d513130d (diff) | |
download | Ishtar-49be6089b2354a71372dfaf71612de08d67986ff.tar.bz2 Ishtar-49be6089b2354a71372dfaf71612de08d67986ff.zip |
Fix access to sheet and permission check for owns
Diffstat (limited to 'ishtar_common/backend.py')
-rw-r--r-- | ishtar_common/backend.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index 261e4dc6f..d5e092fa5 100644 --- a/ishtar_common/backend.py +++ b/ishtar_common/backend.py @@ -55,10 +55,9 @@ class ObjectPermBackend(ModelBackend): if obj is None: model_name = perm.split('_')[-1].lower() model = None - for app in apps.get_apps(): - for modl in apps.get_models(app): - if modl.__name__.lower() == model_name: - model = modl + for modl in apps.get_models(): + if modl.__name__.lower() == model_name: + model = modl if not model: return False return not is_ownperm or model.has_item_of(ishtar_user) |