Skip to content

Document custom domain parameter naming in RBAC with domains - #433

Closed
hsluoyz with Copilot wants to merge 4 commits into
masterfrom
copilot/update-docs-for-pr-1611
Closed

Document custom domain parameter naming in RBAC with domains#433
hsluoyz with Copilot wants to merge 4 commits into
masterfrom
copilot/update-docs-for-pr-1611

Conversation

Copilot AI commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

PR apache/casbin#1611 fixed a bug where renaming the domain parameter from dom to arbitrary names (e.g., tenant, organization) caused enforcement failures. This adds documentation for that fix.

Changes

  • docs/RBACWithDomains.mdx: Added "Custom Domain Parameter Names" section explaining that any parameter name works seamlessly, with SetFieldIndex() only required for non-standard positions

  • docs/SyntaxForModels.mdx: Added "Domain Parameters in Matchers" subsection showing automatic domain token detection

Example

Users can now freely use custom domain names:

[request_definition]
r = sub, tenant, obj, act

[policy_definition]
p = sub, tenant, obj, act

[role_definition]
g = _, _, _

[matchers]
m = g(r.sub, p.sub, r.tenant) && keyMatch(r.tenant, p.tenant) && r.obj == p.obj && r.act == p.act

Casbin automatically detects the domain parameter regardless of name. SetFieldIndex() is only needed when placing the domain parameter in a non-standard position (not second).

Original prompt

This section details on the original issue you should resolve

<issue_title>[docs] add docs for the PR: 1611</issue_title>
<issue_description>Improve the related docs page based on the newly merged PR: apache/casbin#1611
You should write high-quality human-like docs for a modern OSS software. Don't write in the GPT-flavor. Don't write too long, keep it tidy docs. Don't use itemized list to describe things like "Use Cases", "Best practice" or "what it can do"
don't change yarn.lock
Avoid adding new docs pages, try the best to add content to the suitable existing docs pages
Don't add too long text, keep it short and to the point
Don't add the docs in a template like one section name and one text paragraph. You need to organize the content to be user-friendly and not boring for users to read
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@netlify

netlify Bot commented Jan 1, 2026

Copy link
Copy Markdown

Deploy Preview for casbin ready!

Name Link
🔨 Latest commit 9765542
🔍 Latest deploy log https://app.netlify.com/projects/casbin/deploys/69569ab13d18cb0008677009
😎 Deploy Preview https://deploy-preview-433--casbin.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI and others added 2 commits January 1, 2026 16:02
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Co-authored-by: hsluoyz <3787410+hsluoyz@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documentation based on PR 1611 Document custom domain parameter naming in RBAC with domains Jan 1, 2026
Copilot AI requested a review from hsluoyz January 1, 2026 16:06
@hsluoyz
hsluoyz marked this pull request as ready for review January 1, 2026 16:06
@hsluoyz hsluoyz closed this Jan 1, 2026
@hsluoyz
hsluoyz deleted the copilot/update-docs-for-pr-1611 branch March 22, 2026 02:31
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.

[docs] add docs for the PR: 1611

3 participants