Fix 403s when viewing a job as platform admin

While battling the bank holiday traffic on my way home this evening I realised
why looking at the job page was causing lots of 403 errors in the Chrome
console (a spike which was reflected on the Graphite screen).

There is a separate `.json` endpoint for getting updates to a job. This enpoint
did not have the `admin=True` option set in its permissions decorator. So when
viewing a service as a platform admin you could see the page, but not receive
any AJAX-powered updates to it.
This commit is contained in:
Chris Hill-Scott
2016-05-27 19:13:01 +01:00
parent 01884655c7
commit 7a7eb095b1

View File

@@ -111,7 +111,7 @@ def view_job(service_id, job_id):
@main.route("/services/<service_id>/jobs/<job_id>.json")
@login_required
@user_has_permissions('view_activity')
@user_has_permissions('view_activity', admin_override=True)
def view_job_updates(service_id, job_id):
job = job_api_client.get_job(service_id, job_id)['data']
notifications = notification_api_client.get_notifications_for_service(service_id, job_id)