You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User with appropriate permissions can not cancel workflow task.
In the method user_can_cancel of WorkflowState class there is a check if user is in appropriate group:
and "approve"
in [
action[0]
for action in self.current_task_state.task.get_actions(
self.content_object, user
)
]
But self.current_task_state.task is an instance of Task and not GroupApprovalTask so get_actions that is run looks like this:
def get_actions(self, obj, user):
"""
Get the list of action strings (name, verbose_name, whether the action requires additional data - see
``get_form_for_action``) for actions the current user can perform for this task on the given object.
These strings should be the same as those able to be passed to ``on_action``
"""
return []
I propose to fix that issue by in user_can_cancel change self.current_task_state.task.get_actions(...) to self.current_task_state.task.specific.get_actions(...)
Steps to Reproduce
configure workflow with a group selected in a task
create a new object that this task is associated with
login as another user that is in the group associated with the task (or is a superuser)
go to edit page of the object created in step 2
expand the list of available actions at the bottom of the page and gasp in horror that you do not see same buttons as user that created the object.
Technical details
Python version: 3.11.2
Django version: 4.1
Wagtail version: 5.2.3
Browser version: Firefox 122
Working on this
Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.
The text was updated successfully, but these errors were encountered:
Issue Summary
User with appropriate permissions can not cancel workflow task.
In the method
user_can_cancel
ofWorkflowState
class there is a check if user is in appropriate group:But self.current_task_state.task is an instance of
Task
and notGroupApprovalTask
soget_actions
that is run looks like this:I propose to fix that issue by in
user_can_cancel
changeself.current_task_state.task.get_actions(...)
toself.current_task_state.task.specific.get_actions(...)
Steps to Reproduce
Technical details
Working on this
Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.
The text was updated successfully, but these errors were encountered: