Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Add DBA policy and use casbin keyMatch4 so it can match multiple id placeholder

天舟e9be08883eed
diff --git a/backend/server/acl_casbin_model.conf b/backend/server/acl_casbin_model.conf
index e4bb348f63..14a6186d63 100644
--- a/backend/server/acl_casbin_model.conf
+++ b/backend/server/acl_casbin_model.conf
@@ -8,4 +8,4 @@ p = sub, obj, act
e = some(where (p.eft == allow)) # Passes auth if any of the policies allows
[matchers]
-m = r.sub == p.sub && keyMatch2(r.obj, p.obj) && r.act == p.act
\ No newline at end of file
+m = r.sub == p.sub && keyMatch4(r.obj, p.obj) && r.act == p.act
\ No newline at end of file
diff --git a/backend/server/acl_casbin_policy.csv b/backend/server/acl_casbin_policy.csv
index ee6795baf8..efb95159f1 100644
--- a/backend/server/acl_casbin_policy.csv
+++ b/backend/server/acl_casbin_policy.csv
@@ -1,10 +1,16 @@
p, OWNER, /principal, POST
p, OWNER, /principal, GET
-p, OWNER, /principal/:id, GET
-p, OWNER, /principal/:id, PATCH
+p, OWNER, /principal/{id}, GET
+p, OWNER, /principal/{id}, PATCH
p, OWNER, /member, POST
p, OWNER, /member, GET
-p, OWNER, /member/:id, GET
-p, OWNER, /member/:id, PATCH
-p, OWNER, /member/:id, DELETE
\ No newline at end of file
+p, OWNER, /member/{id}, PATCH
+p, OWNER, /member/{id}, DELETE
+
+
+p, DBA, /principal, GET
+p, DBA, /principal/{id}, GET
+p, DBA, /principal/{id}, PATCH
+
+p, DBA, /member, GET
\ No newline at end of file