Skip to content

Commit

Permalink
allow public execution
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Feb 11, 2020
1 parent aecb1de commit 67dd2a1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions phoenix/processes/views/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def __init__(self, request):
self.process = self.wps.describeprocess(self.processid)
super(ExecuteProcess, self).__init__(request, name='processes_execute', title='')

def has_execute_permission(self):
return self.service.public or self.request.has_permission('submit')

def breadcrumbs(self):
breadcrumbs = super(ExecuteProcess, self).breadcrumbs()
breadcrumbs.append(dict(route_path=self.request.route_path('processes'), title='Processes'))
Expand Down Expand Up @@ -89,7 +92,7 @@ def generate_form(self, formid='deform'):
user=self.request.user)
submit_button = Button(name='submit', title='Submit',
css_class='btn btn-success btn-lg btn-block',
disabled=not self.request.has_permission('submit'))
disabled=not self.has_execute_permission())
return Form(
schema.bind(request=self.request),
buttons=(submit_button,),
Expand Down Expand Up @@ -165,7 +168,7 @@ def view(self):
if 'submit' in self.request.POST:
check_csrf_token(self.request)
return self.process_form(form)
if not self.request.has_permission('submit'):
if not self.has_execute_permission():
msg = """<strong>Warning:</strong> You are not allowed to run this process.
Please <a href="{0}" class="alert-link">sign in</a> and wait for account activation."""
msg = msg.format(self.request.route_path('sign_in'))
Expand Down

0 comments on commit 67dd2a1

Please sign in to comment.