Skip to content

Commit

Permalink
Check available in update instead in handleApply so form is not d…
Browse files Browse the repository at this point in the history
…isplayed at all if user have not access.
  • Loading branch information
gbastien committed Apr 4, 2024
1 parent 825ecf7 commit 1d58c2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Changelog

- Import `safe_encode` from `imio.pyutils` instead `imio.helpers`.
[gbastien]
- Check available in `update` instead in `handleApply` so form is not
displayed at all if user have not access.
[gbastien]

1.14 (2023-09-04)
-----------------
Expand Down
6 changes: 3 additions & 3 deletions src/collective/eeafaceted/batchactions/browser/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ def _apply(self, **data):
raise NotImplementedError

def update(self):
if not self.available():
raise Unauthorized

form = self.request.form
if 'form.widgets.uids' in form:
uids = form['form.widgets.uids']
Expand All @@ -132,9 +135,6 @@ def update(self):
@button.buttonAndHandler(_(u'Apply'), name='apply', condition=lambda fi: fi.do_apply)
def handleApply(self, action):
""" """
if not self.available():
raise Unauthorized

data, errors = self.extractData()
if errors:
self.status = self.formErrorsMessage
Expand Down

0 comments on commit 1d58c2a

Please sign in to comment.