apache / apache/casbin

How should we treat circular link? remove OR keep OR...

Open
#446 10 comments 0 reactions 1 assignee Claimed by @hsluoyz View on GitHub
enhancement
Dominant language
Go
Stars
20.4k
Forks
1.8k
Avg merge
5d 11h
Merged PRs (30d)
2

Description

model.conf
```ini
[request_definition]
r = sub, obj, act

[policy_definition]
p = sub, obj, act

[role_definition]
g = _, _

[policy_effect]
e = some(where (p.eft == allow))

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

policy.csv
```csv
p, book_admin , /book/1, GET
p, pen_admin , /pen/1, GET

g, *, book_admin
g, *, pen_admin
```

pattern matching func
```
KeyMatch
```

function call
```
e.GetImplicitRolesForUser("book_admin")

OR

e.GetImplicitRolesForUser("pen_admin")
```

**Expected output**
```
[]
```

**Actual output**
```
["*", "book_admin", "pen_admin"]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.