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

Unified Diff: appengine/swarming/handlers_endpoints.py

Issue 2272193004: Add endpoint for permissions (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@migrate-botlist
Patch Set: Created 4 years, 4 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_endpoints_test.py » ('j') | no next file with comments »
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 5bc4701537d18e1eebcce2cb1f15c7b6f4e3ea4a..8e949688bc8ce144cfe39a405eddf9e7e8bd491f 100644
--- a/appengine/swarming/handlers_endpoints.py
+++ b/appengine/swarming/handlers_endpoints.py
@@ -137,6 +137,24 @@ class SwarmingServerService(remote.Service):
@gae_ts_mon.instrument_endpoint()
@auth.endpoints_method(
+ message_types.VoidMessage, swarming_rpcs.ServerPermissions,
+ http_method='GET')
+ @auth.public
+ def permissions(self, _request):
+ """Returns the caller's permissions."""
+ return swarming_rpcs.ServerPermissions(
+ can_delete_bot = acl.is_admin(),
+ can_terminate_bot = acl.is_privileged_user(),
+ can_get_bootstrap_py = acl.is_user(),
M-A Ruel 2016/08/25 18:22:22 bootstrap and bot_config are redundant
kjlubick 2016/08/25 19:33:37 Consolidated to can_get_configs and can_put_config
+ can_put_bootstrap_py = acl.is_admin(),
+ can_get_bot_config_py = acl.is_user(),
+ can_put_bot_config_py = acl.is_admin(),
+ can_cancel_task = acl.is_user(),
+ can_get_bootstrap_token = acl.is_bootstrapper(),
+ )
+
+ @gae_ts_mon.instrument_endpoint()
+ @auth.endpoints_method(
VersionRequest, swarming_rpcs.FileContent,
http_method='GET')
@auth.require(acl.is_bot_or_user)
« no previous file with comments | « no previous file | appengine/swarming/handlers_endpoints_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698