Skip to content

Commit

Permalink
feat: [torrust#615] initial casbin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-nt committed Jun 17, 2024
1 parent 7d547b1 commit 8313dae
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions casbin/model.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[request_definition]
r = sub, act

[policy_definition]
p = sub, act

[role_definition]
g = _, _

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

[matchers]
m = g(r.sub, p.sub) && r.act == p.act
13 changes: 13 additions & 0 deletions casbin/policy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
p, alice, data1, read
p, bob, data2, write
p, data2_admin, data2, read
p, data2_admin, data2, write
p, admin, A
p, testuser, AddCategory
p, admin, AddCategory
p, admin, ACTION::DeleteCategory


g, alice, data2_admins

g, alice, data2_admin

0 comments on commit 8313dae

Please sign in to comment.