def check_action_edition_permission(view_func):
 def decorate(request, *args, **kwargs):
  action = kwargs.get('action')
  Job.objects.can_edit_or_exception(request, action.workflow)
  return view_func(request, *args, **kwargs)
 return wraps(view_func)(decorate)

def check_action_edition_permission ( view_func ) : def decorate ( request , * args , ** kwargs ) : action = kwargs . get ( 'action' ) Job . objects . can_edit_or_exception ( request , action . workflow ) return view_func ( request , * args , ** kwargs ) return wraps ( view_func ) ( decorate )
decorator ensuring that the user has the permissions to modify a workflow action .