From 7be596f41305b4be26796625bd800d58a04bb0a7 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 23 Aug 2013 18:25:58 +0200 Subject: PersonType from single value to multi value for Person --- ishtar_common/backend.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ishtar_common/backend.py') diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index f50edd708..297c96180 100644 --- a/ishtar_common/backend.py +++ b/ishtar_common/backend.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2011 Étienne Loks +# Copyright (C) 2010-2013 Étienne Loks # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -50,8 +50,7 @@ class ObjectOwnPermBackend(object): assert perm.split('.')[-1].split('_')[1] == 'own' except (IndexError, AssertionError): return False - if ishtar_user.person.person_type \ - == models.PersonType.objects.get(txt_idx="administrator"): + if ishtar_user.has_right('administrator'): return True if obj is None: model_name = perm.split('_')[-1].capitalize() -- cgit v1.2.3