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 by the Apache v2.0 license that can be | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
4 | 4 |
5 import re | 5 import re |
6 | 6 |
7 from components import auth | 7 from components import auth |
8 from components import config | 8 from components import config |
9 from components import utils | 9 from components import utils |
10 from components.config.proto import service_config_pb2 | 10 from components.config.proto import service_config_pb2 |
11 | 11 |
12 import common | 12 import common |
13 import projects | 13 import projects |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 | 68 |
69 def has_project_access(project_id): | 69 def has_project_access(project_id): |
70 metadata = projects.get_metadata(project_id) | 70 metadata = projects.get_metadata(project_id) |
71 super_group = read_acl_cfg().project_access_group | 71 super_group = read_acl_cfg().project_access_group |
72 return ( | 72 return ( |
73 auth.is_admin() or | 73 auth.is_admin() or |
74 super_group and auth.is_group_member(super_group) or | 74 super_group and auth.is_group_member(super_group) or |
75 metadata and config.api._has_access(metadata.access) | 75 metadata and config.api._has_access(metadata.access) |
76 ) | 76 ) |
OLD | NEW |