Skip to content

[RHCLOUD-47173] Write the "Migrate Existing Applications to RBAC" How To Guide - #131

Open
Ellen-Yi-Dong wants to merge 2 commits into
project-kessel:mainfrom
Ellen-Yi-Dong:migrate-to-rbac-v2
Open

[RHCLOUD-47173] Write the "Migrate Existing Applications to RBAC" How To Guide#131
Ellen-Yi-Dong wants to merge 2 commits into
project-kessel:mainfrom
Ellen-Yi-Dong:migrate-to-rbac-v2

Conversation

@Ellen-Yi-Dong

Copy link
Copy Markdown
Contributor

Related JIRA link: https://redhat.atlassian.net/browse/RHCLOUD-47173

Acceptance Criteria as listed within the task:
File: src/content/docs/building-with-kessel/how-to/migrate-to-rbac.mdx

Description: This page is a TODO stub focused on migration patterns for existing applications adopting Kessel RBAC for the first time.

Acceptance Criteria:

  • Document patterns for applications with existing workspace/grouping abstractions
  • Document patterns for applications with no existing authorization model
  • Include step-by-step migration checklist
  • Cover dual-running strategies (old and new auth in parallel)
  • Avoid duplicating content from design-permissions.mdx – cross-reference instead

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c39af504-8750-44e0-a8e7-00e459b59194


Comment @coderabbitai help to get the list of available commands.


### Permission schema

- [ ] Write `.ksl` permission definitions using `@rbac.add_v1_based_permission()` for permissions that need wildcard support

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add @rbac.add_unified_permission and tell the difference there?

The Default workspace represents "all resources in this organization that aren't explicitly placed elsewhere." By checking permissions against the Default workspace, your application gets org-wide authorization that matches the current behavior:

<Steps>
1. Look up the Default workspace ID for the tenant using `GET /api/rbac/v2/workspaces/?type=default`. Cache this value — it never changes for a given tenant.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use with_ancestry=true to bypass validation

- **Add a `workspace_id` column early** — Even if every resource points to the Default workspace initially, having the column makes future migration straightforward.
- **Use role bindings, not direct grants** — All access must go through role bindings on workspaces or tenants. This is how Kessel's authorization graph works; there is no mechanism for granting permissions directly on individual resources.

For guidance on structuring your permission schema, see [Design Permissions Schema](/docs/building-with-kessel/how-to/design-permissions/).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ref file is TODO, is it in a followup?

@Ellen-Yi-Dong Ellen-Yi-Dong Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


The Default workspace represents "all resources in this organization that aren't explicitly placed elsewhere." By checking permissions against the Default workspace, your application gets org-wide authorization that matches the current behavior:

<Steps>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it worth to add instructions of auth here? "explanation lives in migrate-from-rbac-v1-to-v2.mdx (lines 188–195) and migration-pattern-reference.md (lines 362–364)"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it might be repeating information if we want to keep it concise?
I can add like a "tip" box and a direct link to the information for more information about the configuring the Kessel client endpoints and authentication credentials if that might help provide a clearer direction?

@Ellen-Yi-Dong
Ellen-Yi-Dong requested a review from astrozzc August 26, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants