Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: appengine/swarming/handlers_endpoints.py

Issue 2463483002: swarming: allow privileged users to schedule high priority tasks (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/swarming/handlers_frontend.py » ('j') | appengine/swarming/server/acl.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/handlers_endpoints.py
diff --git a/appengine/swarming/handlers_endpoints.py b/appengine/swarming/handlers_endpoints.py
index a327e07505071ea2671f00782f93ab8d0b6bbf27..cb01352f732b22be6eddef6c2220b30ba632f6ed 100644
--- a/appengine/swarming/handlers_endpoints.py
+++ b/appengine/swarming/handlers_endpoints.py
@@ -343,7 +343,8 @@ class SwarmingTasksService(remote.Service):
request = message_conversion.new_task_request_from_rpc(
request, utils.utcnow())
apply_property_defaults(request.properties)
- task_request.init_new_request(request, acl.is_bot_or_admin())
+ task_request.init_new_request(
+ request, acl.can_schedule_high_priority_tasks())
except (datastore_errors.BadValueError, TypeError, ValueError) as e:
raise endpoints.BadRequestException(e.message)
@@ -601,7 +602,7 @@ class SwarmingBotService(remote.Service):
try:
# Craft a special priority 0 task to tell the bot to shutdown.
request = task_request.create_termination_task(
- bot_id, acl.is_bot_or_admin())
+ bot_id, acl.can_schedule_high_priority_tasks())
except (datastore_errors.BadValueError, TypeError, ValueError) as e:
raise endpoints.BadRequestException(e.message)
« no previous file with comments | « no previous file | appengine/swarming/handlers_frontend.py » ('j') | appengine/swarming/server/acl.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698