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

Side by Side Diff: appengine/config_service/acl.py

Issue 2931673003: config_service: fetch repos and metadata concurrently (Closed)
Patch Set: use ctx.memcache_[gs]et Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | appengine/config_service/acl_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The LUCI Authors. All rights reserved. 1 # Copyright 2015 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 from components import auth 5 from components import auth
6 from components import config 6 from components import config
7 from components import utils 7 from components import utils
8 from components.config.proto import service_config_pb2 8 from components.config.proto import service_config_pb2
9 9
10 import common 10 import common
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 for sid in service_ids 92 for sid in service_ids
93 } 93 }
94 94
95 95
96 def has_projects_access(project_ids): 96 def has_projects_access(project_ids):
97 if not project_ids: 97 if not project_ids:
98 return {} 98 return {}
99 super_group = get_acl_cfg().project_access_group 99 super_group = get_acl_cfg().project_access_group
100 if is_admin() or super_group and auth.is_group_member(super_group): 100 if is_admin() or super_group and auth.is_group_member(super_group):
101 return {pid: True for pid in project_ids} 101 return {pid: True for pid in project_ids}
102 metadata = projects.get_metadata_async(project_ids).get_result()
102 return { 103 return {
103 pid: meta and config.api._has_access(meta.access) 104 pid: meta and config.api._has_access(meta.access)
104 for pid, meta in projects.get_metadata(project_ids).iteritems() 105 for pid, meta in metadata.iteritems()
105 } 106 }
OLDNEW
« no previous file with comments | « no previous file | appengine/config_service/acl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698