diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-12-13 19:03:38 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-12-13 19:03:38 +0100 |
commit | 8013cdaddc1c9b87c843a9ca857caba9d1fd20f2 (patch) | |
tree | 53bbd0940385c35842abb86b331e477b0de1356e /ishtar_common | |
parent | 651985660e22e3569d450ebe3cfda9f55d54fbbf (diff) | |
download | Ishtar-8013cdaddc1c9b87c843a9ca857caba9d1fd20f2.tar.bz2 Ishtar-8013cdaddc1c9b87c843a9ca857caba9d1fd20f2.zip |
Fix rights for finds and contextrecords
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/backend.py | 4 | ||||
-rw-r--r-- | ishtar_common/models.py | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index 0febd61b2..f48e6ddec 100644 --- a/ishtar_common/backend.py +++ b/ishtar_common/backend.py @@ -53,11 +53,11 @@ class ObjectPermBackend(ModelBackend): if not main_right or not is_ownperm: return main_right if obj is None: - model_name = perm.split('_')[-1].capitalize() + model_name = perm.split('_')[-1].lower() model = None for app in cache.get_apps(): for modl in cache.get_models(app): - if modl.__name__ == model_name: + if modl.__name__.lower() == model_name: model = modl if not model: return False diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 48218ba94..c4dcd4c44 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1982,6 +1982,7 @@ class Person(Address, Merge, OwnPerms, ValueGetter): res = cache.get(cache_key) if res in (True, False): return res + if type(right_name) in (list, tuple): res = bool(self.person_types.filter( txt_idx__in=right_name).count()) or \ |