diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/forms_common.py | 4 | ||||
-rw-r--r-- | ishtar_common/menu_base.py | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index cb7eb761a..1a04a38e9 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -1264,7 +1264,7 @@ class IshtarUserSelect(TableSelect): self.fields["person_types"].choices = models.PersonType.get_types() -class AccountFormSelection(forms.Form): +class AccountFormSelection(CustomForm, forms.Form): SEARCH_AND_SELECT = True form_label = _("Account search") associated_models = {"pk": models.IshtarUser} @@ -2915,7 +2915,7 @@ class AuthorForm(ManageOldType, NewItemForm): return new_item -class AuthorFormSelection(forms.Form): +class AuthorFormSelection(CustomForm, forms.Form): form_label = _("Author selection") NO_CUSTOM_FORM = True base_model = "author" diff --git a/ishtar_common/menu_base.py b/ishtar_common/menu_base.py index feb05c6db..809dd1c2d 100644 --- a/ishtar_common/menu_base.py +++ b/ishtar_common/menu_base.py @@ -108,10 +108,9 @@ class MenuItem: return True if not hasattr(user, "ishtaruser"): return False - ishtaruser = user.ishtaruser for access_control in self.access_controls: # check by profile - if ishtaruser.has_permission(access_control): + if user.has_perm(access_control): return True return False @@ -122,9 +121,8 @@ class MenuItem: return True if not hasattr(user, "ishtaruser"): return False - ishtaruser = user.ishtaruser for access_control in self.access_controls: - if ishtaruser.has_permission( + if user.has_perm( access_control, obj=obj ): return True |