FLPATH-3319: wire 23 cost_management permissions through role_binding, tenant, workspace#737
Open
jordigilh wants to merge 1 commit intoRedHatInsights:masterfrom
Conversation
…, tenant, workspace The production schema.zed declares 23 cost_management_* permissions on rbac/role but does not propagate them through rbac/role_binding, rbac/tenant, or rbac/workspace. Without this wiring, CheckPermission() and LookupResources() cannot resolve cost management permissions through the authorization chain. This commit adds the missing propagation for all 23 permissions (13 OCP-scoped + 10 cloud-scoped) following the identical pattern used by every other service in the schema. Made-with: Cursor
This was referenced Mar 6, 2026
Closed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The production
schema.zedalready declares 23cost_management_*permissions onrbac/role(each with at_cost_management_*relation typedrbac/principal:*), but these permissions are not propagated throughrbac/role_binding,rbac/tenant, orrbac/workspace.Without this wiring,
CheckPermission()andLookupResources()calls cannot resolve cost management permissions through the standard authorization chain:Every other service in the schema (inventory, notifications, content_sources, remediations, playbook_dispatcher, config_manager, staleness, ros) already has its permissions wired through all three definitions. Cost Management is the only service with permissions declared on
rbac/rolebut missing from the rest of the chain.What this PR adds
69 new lines in
configs/prod/schemas/schema.zed— 23 permissions propagated through each of the three definitions:rbac/role_binding(23 permissions)This is the exact same pattern used by
inventory_host_view,notifications_events_view,content_sources_repository_edit, etc. Thesubject &intersection ensures the permission only resolves when the principal is both the subject of the binding AND the role grants the permission.rbac/tenant(23 permissions)Same pattern as all existing services. Permissions are resolved from either direct role bindings on the tenant or inherited from the platform.
rbac/workspace(23 permissions)Same pattern as all existing services. Permissions are resolved from either direct role bindings on the workspace or inherited from the parent (workspace or tenant).
Permission breakdown (23 total)
OCP-scoped (13)
cost_management_all_allcost-management:*:*cost_management_openshift_cluster_allcost-management:openshift.cluster:*cost_management_openshift_cluster_readcost-management:openshift.cluster:readcost_management_openshift_node_allcost-management:openshift.node:*cost_management_openshift_node_readcost-management:openshift.node:readcost_management_openshift_project_allcost-management:openshift.project:*cost_management_openshift_project_readcost-management:openshift.project:readcost_management_cost_model_allcost-management:cost_model:*cost_management_cost_model_readcost-management:cost_model:readcost_management_cost_model_writecost-management:cost_model:writecost_management_settings_allcost-management:settings:*cost_management_settings_readcost-management:settings:readcost_management_settings_writecost-management:settings:writeCloud-scoped (10)
cost_management_aws_account_allcost-management:aws.account:*cost_management_aws_account_readcost-management:aws.account:readcost_management_aws_organizational_unit_allcost-management:aws.organizational_unit:*cost_management_aws_organizational_unit_readcost-management:aws.organizational_unit:readcost_management_azure_subscription_guid_allcost-management:azure.subscription_guid:*cost_management_azure_subscription_guid_readcost-management:azure.subscription_guid:readcost_management_gcp_account_allcost-management:gcp.account:*cost_management_gcp_account_readcost-management:gcp.account:readcost_management_gcp_project_allcost-management:gcp.project:*cost_management_gcp_project_readcost-management:gcp.project:readCloud permissions are wired now so that Koku and the SaaS schema are ready when SaaS onboards Kessel for cost management.
Why this is needed
Cost Management (Koku) is integrating with Kessel for on-prem authorization. The Kessel Relations API issues
CheckPermission()andLookupResources()calls against SpiceDB using these permission names. The authorization resolution path requires permissions to be declared on every definition in the chain — not justrbac/role. Without this wiring:CheckPermission(rbac/workspace:<id>, cost_management_openshift_cluster_read, rbac/principal:<user>)→ fails (permission not found on workspace)LookupResources(rbac/workspace, cost_management_openshift_cluster_read, rbac/principal:<user>)→ returns empty (permission not traversable)After this PR, both calls resolve correctly through the full chain, matching the behavior of every other service.
Validation
These permissions have been validated end-to-end on an on-prem deployment using local copies of the schema bundled in the Helm chart. Koku and ros-ocp-backend both successfully resolve permissions through
CheckPermission()andLookupResources()for all 23 cost management permission types, covering admin, viewer, and no-access user roles. This PR upstreams them so they are available in the canonical schema definitions.Related PRs
JIRA
FLPATH-3319
Made with Cursor