Skip to content

Instantly share code, notes, and snippets.

@angstwad
Created March 25, 2020 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angstwad/87ee2ad398ef4531d8a458c70ba176c8 to your computer and use it in GitHub Desktop.
Save angstwad/87ee2ad398ef4531d8a458c70ba176c8 to your computer and use it in GitHub Desktop.
Snippets for Blog: Solving a Set Cover Problem in Cloud IAM on GCP
subset_roles = set()
for this_role, _ in roles_sorted_by_perms_asc:
for other_role, other_perms in roles_to_perms.items():
if this_role == other_role:
continue
this_perms = roles_to_perms[this_role]
if this_perms.issubset(other_perms):
subset_roles.add(this_role)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment