diff --git a/casbin/model.conf b/casbin/model.conf new file mode 100644 index 00000000..5f7e0a7d --- /dev/null +++ b/casbin/model.conf @@ -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 \ No newline at end of file diff --git a/casbin/policy.csv b/casbin/policy.csv new file mode 100644 index 00000000..3441300b --- /dev/null +++ b/casbin/policy.csv @@ -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 \ No newline at end of file