Skip to content

Commit 27005f8

Browse files
authored
fix: support pattern function in 3rd args of g (#199)
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
1 parent dc22145 commit 27005f8

8 files changed

+268
-103
lines changed
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[request_definition]
2+
r = sub, dom, obj, act
3+
4+
[policy_definition]
5+
p = sub, dom, obj, act
6+
7+
[role_definition]
8+
g = _, _, _
9+
10+
[policy_effect]
11+
e = some(where (p.eft == allow))
12+
13+
[matchers]
14+
m = r.sub == p.sub && g(r.obj, p.obj, r.dom) && r.dom == p.dom && r.act == p.act
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
p, alice, domain1, book_group, read
2+
p, alice, domain2, book_group, write
3+
4+
g, /book/:id, book_group, *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[request_definition]
2+
r = sub, dom, obj, act
3+
4+
[policy_definition]
5+
p = sub, dom, obj, act
6+
7+
[role_definition]
8+
g = _, _, _
9+
10+
[policy_effect]
11+
e = some(where (p.eft == allow))
12+
13+
[matchers]
14+
m = g(r.sub, p.sub, r.dom) && r.dom == p.dom && r.obj == p.obj && r.act == p.act
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
p, admin, domain1, data1, read
2+
p, admin, domain1, data1, write
3+
p, admin, domain2, data2, read
4+
p, admin, domain2, data2, write
5+
6+
g, alice, admin, *
7+
g, bob, admin, domain2

0 commit comments

Comments
 (0)