From 7a7eb095b1a68bd3ff1b486a96f651a9b52bd0b8 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 27 May 2016 19:13:01 +0100 Subject: [PATCH] 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. --- app/main/views/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/main/views/jobs.py b/app/main/views/jobs.py index 108281368..b2804a6c1 100644 --- a/app/main/views/jobs.py +++ b/app/main/views/jobs.py @@ -111,7 +111,7 @@ def view_job(service_id, job_id): @main.route("/services//jobs/.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)