| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |