Skip to content

feat: make casbin rule matching consider domain hierarchy - #301

Closed
Panaetius wants to merge 1 commit into
mainfrom
feat/casbin-domain-hieararchy
Closed

Panaetius wants to merge 1 commit into
mainfrom
feat/casbin-domain-hieararchy

Conversation

@Panaetius

@Panaetius Panaetius commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

This makes casbin automatically check hierarchical permissions, so when asking for permission on a child, it also checks permission on a parent.

Rule Query Considered
/hackathon/h1 /hackathon/h1 ✔️
/hackathon/h1/team/t1 /hackathon/h1/team/t1 ✔️
/hackathon/h1 /hackathon/h1/team/t1 ✔️
/hackathon/h1/team/t1 /hackathon/h1 ❌

so if you ask if you can do X on child t1, and you have permission for X on parent h1, it is allowed. But not the other way around, permission on a child does not give permission on the parent.
And it's still resource scoped, so permission on parent for "teams" does not give permission on a child for "project".

@sabinem
sabinem force-pushed the feat/casbin-domain-hieararchy branch from b04a993 to 18d8afe Compare September 14, 2026 09:44
@sabinem

sabinem commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Close, but reopen later: see #76.

@sabinem sabinem closed this Oct 26, 2026
@sabinem
sabinem deleted the feat/casbin-domain-hieararchy branch October 26, 2026 15:58
@sabinem
sabinem restored the feat/casbin-domain-hieararchy branch October 27, 2026 16:48
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