Skip to content

Commit bed7d63

Browse files
committed
feat: [torrust#615] initial casbin configuration
1 parent 78233cc commit bed7d63

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

casbin/model.conf

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[request_definition]
2+
r = sub, act
3+
4+
[policy_definition]
5+
p = sub, 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.act == p.act

casbin/policy.csv

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
p, alice, data1, read
2+
p, bob, data2, write
3+
p, data2_admin, data2, read
4+
p, data2_admin, data2, write
5+
p, admin, A
6+
p, testuser, AddCategory
7+
p, admin, AddCategory
8+
p, admin, ACTION::DeleteCategory
9+
10+
11+
g, alice, data2_admins
12+
13+
g, alice, data2_admin

0 commit comments

Comments
 (0)