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

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: Address comments 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..988632cecf45c3f5fa56593eb5c38490fb31f408 100644
--- a/appengine/swarming/handlers_endpoints.py
+++ b/appengine/swarming/handlers_endpoints.py
@@ -137,6 +137,22 @@ class SwarmingServerService(remote.Service):
@gae_ts_mon.instrument_endpoint()
@auth.endpoints_method(
+ message_types.VoidMessage, swarming_rpcs.ClientPermissions,
+ http_method='GET')
+ @auth.public
+ def permissions(self, _request):
+ """Returns the caller's permissions."""
+ return swarming_rpcs.ClientPermissions(
+ delete_bot = acl.is_admin(),
+ terminate_bot = acl.is_privileged_user(),
+ get_configs = acl.is_user(),
+ put_configs = acl.is_admin(),
+ cancel_task = acl.is_user(),
+ 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