gcp-platforms-auto 0.7.5__tar.gz → 0.7.7__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gcp_platforms_auto
3
- Version: 0.7.5
3
+ Version: 0.7.7
4
4
  Summary: A brief description of your package
5
5
  Author-email: ofir4858 <ofirshasha10@gmail.com>
6
6
  License: MIT
@@ -12,4 +12,8 @@ from .db import (
12
12
  update_model,
13
13
  delete_model,
14
14
  Base
15
+ )
16
+ from .iam import (
17
+ check_user_has_role_in_project,
18
+ get_projects_with_role
15
19
  )
@@ -31,7 +31,7 @@ def _get_identity_string(email: str) -> str:
31
31
  return f"user:{email}"
32
32
 
33
33
 
34
- def check_user_has_role(
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 = check_user_has_role(
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 check_user_has_role(
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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gcp_platforms_auto
3
- Version: 0.7.5
3
+ Version: 0.7.7
4
4
  Summary: A brief description of your package
5
5
  Author-email: ofir4858 <ofirshasha10@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gcp_platforms_auto"
7
- version = "0.7.5"
7
+ version = "0.7.7"
8
8
  description = "A brief description of your package"
9
9
  readme = "README.md"
10
10
  authors = [