def check_job_edition_permission(authorize_get=False, exception_class=PopupException):
 def inner(view_func):
  def decorate(request, *args, **kwargs):
   if ('workflow' in kwargs):
    job_type = 'workflow'
   elif ('coordinator' in kwargs):
    job_type = 'coordinator'
   else:
    job_type = 'bundle'
   job = kwargs.get(job_type)
   if ((job is not None) and (not (authorize_get and (request.method == 'GET')))):
    Job.objects.can_edit_or_exception(request, job, exception_class=exception_class)
   return view_func(request, *args, **kwargs)
  return wraps(view_func)(decorate)
 return inner

def check_job_edition_permission ( authorize_get = False , exception_class = PopupException ) : def inner ( view_func ) : def decorate ( request , * args , ** kwargs ) : if ( 'workflow' in kwargs ) : job_type = 'workflow' elif ( 'coordinator' in kwargs ) : job_type = 'coordinator' else : job_type = 'bundle' job = kwargs . get ( job_type ) if ( ( job is not None ) and ( not ( authorize_get and ( request . method == 'GET' ) ) ) ) : Job . objects . can_edit_or_exception ( request , job , exception_class = exception_class ) return view_func ( request , * args , ** kwargs ) return wraps ( view_func ) ( decorate ) return inner
decorator ensuring that the user has the permissions to modify a workflow or coordinator .