Created
March 25, 2020 14:45
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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