Skip to content

Commit be3596f

Browse files
committed
Fix matcher.
1 parent 068cd64 commit be3596f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ g = _, _
6464
e = some(where (p.eft == allow))
6565

6666
[matchers]
67-
m = g(r.sub, p.sub) && r.obj == p.obj && r.act == p.act
67+
m = (p.sub == "*" || g(r.sub, p.sub)) && r.obj == p.obj && (p.act == "*" || r.act == p.act)
6868
```
6969
Example Policy
7070
This example file can be found in `tests/casbin_files`

tests/casbin_files/rbac_model.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ g = _, _
1111
e = some(where (p.eft == allow))
1212

1313
[matchers]
14-
m = g(r.sub, p.sub) && r.obj == p.obj && r.act == p.act
14+
m = (p.sub == "*" || g(r.sub, p.sub)) && r.obj == p.obj && (p.act == "*" || r.act == p.act)

0 commit comments

Comments
 (0)