Skip to content

Commit

Permalink
Update rbac.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lcouzens authored Apr 5, 2024
1 parent 7949128 commit cf26bfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions koku/koku/rbac.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def _update_access_obj(access, res_access, resource_list):
access_items = access.get(res, [])
# Set OpenShift rbac inheritance cluster->node->project if higher level is restricted
if res == "openshift.node":
if not access_items and res_access["openshift.cluster"]:
if not access_items and res_access["openshift.cluster"]["read"] != []:
access_items = [{"operation": "read", "resources": ["*"]}]

Check warning on line 112 in koku/koku/rbac.py

View check run for this annotation

Codecov / codecov/patch

koku/koku/rbac.py#L112

Added line #L112 was not covered by tests
if res == "openshift.project":
if not access_items and res_access["openshift.node"]:
if not access_items and res_access["openshift.node"]["read"] != []:
access_items = [{"operation": "read", "resources": ["*"]}]

Check warning on line 115 in koku/koku/rbac.py

View check run for this annotation

Codecov / codecov/patch

koku/koku/rbac.py#L115

Added line #L115 was not covered by tests
for access_item in access_items:
operation = _get_operation(access_item, res)
Expand Down

0 comments on commit cf26bfd

Please sign in to comment.