summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-08-29 16:28:29 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-08-29 16:28:29 +0200
commit911c9bfdbc0bffa79a1509e5709a8009db7d0938 (patch)
treec3dd6901c6d30abe08cb7ab5d41c4c116712d84f
parentd323cdcbf698fefa9f2d29589261d0757f4417c9 (diff)
downloadIshtar-911c9bfdbc0bffa79a1509e5709a8009db7d0938.tar.bz2
Ishtar-911c9bfdbc0bffa79a1509e5709a8009db7d0938.zip
Fix bad user permission management (refs #1369)
-rw-r--r--ishtar_common/menu_base.py2
-rw-r--r--ishtar_common/models.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/ishtar_common/menu_base.py b/ishtar_common/menu_base.py
index 11ce4e688..9ae378b8e 100644
--- a/ishtar_common/menu_base.py
+++ b/ishtar_common/menu_base.py
@@ -62,7 +62,7 @@ class MenuItem:
return True
# manage by person type
if hasattr(user, 'ishtaruser'):
- if ishtar_user.has_right(self.idx):
+ if user.ishtaruser.has_right(self.idx):
return True
return False
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 0a7c3e1f9..893c3b481 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -671,10 +671,10 @@ class Person(Address, OwnPerms) :
def has_right(self, right_name):
if type(right_name) in (list, tuple):
return bool(
- self.person_types.filter(txt_idx__in=right_name).count() or
- self.person_types.filter(wizard__url_name__in=right_name).count())
- return bool(self.person_types.filter(txt_idx=right_name).count() or
- self.person_types.filter(wizard__url_name=right_name).count())
+ self.person_types.filter(txt_idx__in=right_name).count())
+ # or self.person_types.filter(wizard__url_name__in=right_name).count())
+ return bool(self.person_types.filter(txt_idx=right_name).count())
+ # or self.person_types.filter(wizard__url_name=right_name).count())
def full_label(self):
values = []