gcp-platforms-auto 0.7.5__py3-none-any.whl → 0.7.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gcp_platforms_auto/__init__.py +4 -0
- gcp_platforms_auto/iam.py +4 -4
- {gcp_platforms_auto-0.7.5.dist-info → gcp_platforms_auto-0.7.7.dist-info}/METADATA +1 -1
- gcp_platforms_auto-0.7.7.dist-info/RECORD +8 -0
- gcp_platforms_auto-0.7.5.dist-info/RECORD +0 -8
- {gcp_platforms_auto-0.7.5.dist-info → gcp_platforms_auto-0.7.7.dist-info}/WHEEL +0 -0
- {gcp_platforms_auto-0.7.5.dist-info → gcp_platforms_auto-0.7.7.dist-info}/top_level.txt +0 -0
gcp_platforms_auto/__init__.py
CHANGED
gcp_platforms_auto/iam.py
CHANGED
|
@@ -31,7 +31,7 @@ def _get_identity_string(email: str) -> str:
|
|
|
31
31
|
return f"user:{email}"
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
def
|
|
34
|
+
def check_user_has_role_in_project(
|
|
35
35
|
project_id: str,
|
|
36
36
|
user_email: str,
|
|
37
37
|
organization_id: str,
|
|
@@ -53,10 +53,10 @@ def check_user_has_role(
|
|
|
53
53
|
bool: True if the user/service account has the role in the project, False otherwise
|
|
54
54
|
|
|
55
55
|
Example:
|
|
56
|
-
>>> has_access =
|
|
56
|
+
>>> has_access = check_user_has_role_in_project(
|
|
57
57
|
... user_email='oshasha10@dev.sky320.com',
|
|
58
58
|
... role='roles/owner',
|
|
59
|
-
... project_id='sky-starfi-mam-res-gcpro-1'
|
|
59
|
+
... project_id='sky-starfi-mam-res-gcpro-1',
|
|
60
60
|
... )
|
|
61
61
|
"""
|
|
62
62
|
client = asset_v1.AssetServiceClient()
|
|
@@ -195,7 +195,7 @@ def get_projects_with_role(
|
|
|
195
195
|
|
|
196
196
|
for project_id in all_projects:
|
|
197
197
|
# Check if user has the role in this project
|
|
198
|
-
if
|
|
198
|
+
if check_user_has_role_in_project(
|
|
199
199
|
project_id=project_id,
|
|
200
200
|
user_email=user_email,
|
|
201
201
|
organization_id=organization_id,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
gcp_platforms_auto/__init__.py,sha256=lxzogGyaV44AUl6WVElBOZNlr_gpWLvppZew7QDr1pw,407
|
|
2
|
+
gcp_platforms_auto/db.py,sha256=jE5nwmqVHcxT4m6-meUgUz4V4DM8M_sMmeTpvKr2Z2Y,8768
|
|
3
|
+
gcp_platforms_auto/git.py,sha256=NnLDfRzzrzbm9yekepc-qgu8ejYmjNxQ4VDlW46gG2o,5508
|
|
4
|
+
gcp_platforms_auto/iam.py,sha256=zMABOcwhPTCEpwQd1Atm5ccd3-6jOLHPSDJUDq9YuFE,7687
|
|
5
|
+
gcp_platforms_auto-0.7.7.dist-info/METADATA,sha256=43WaEHjVp302waNQ74iwdBEcTO_-18E3P03lM-QNy50,621
|
|
6
|
+
gcp_platforms_auto-0.7.7.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
7
|
+
gcp_platforms_auto-0.7.7.dist-info/top_level.txt,sha256=4q-ofPMmvBaTnIbAzs-Wp_OwheAVxxmJ1fW9vl3-kyE,19
|
|
8
|
+
gcp_platforms_auto-0.7.7.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
gcp_platforms_auto/__init__.py,sha256=jpdcmFArf_rwuQ0Cn26GUq5_DxSbGF6oMwxSKYu7ELY,322
|
|
2
|
-
gcp_platforms_auto/db.py,sha256=jE5nwmqVHcxT4m6-meUgUz4V4DM8M_sMmeTpvKr2Z2Y,8768
|
|
3
|
-
gcp_platforms_auto/git.py,sha256=NnLDfRzzrzbm9yekepc-qgu8ejYmjNxQ4VDlW46gG2o,5508
|
|
4
|
-
gcp_platforms_auto/iam.py,sha256=h3NytTLB04eO6TvxVwBN2vWJOElGQaEkWeoNkRD6BVI,7653
|
|
5
|
-
gcp_platforms_auto-0.7.5.dist-info/METADATA,sha256=IJDfoM9XSyYJlKAk7dEGE1o7noOIDBpF6p0j5rAoFfo,621
|
|
6
|
-
gcp_platforms_auto-0.7.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
7
|
-
gcp_platforms_auto-0.7.5.dist-info/top_level.txt,sha256=4q-ofPMmvBaTnIbAzs-Wp_OwheAVxxmJ1fW9vl3-kyE,19
|
|
8
|
-
gcp_platforms_auto-0.7.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|