Skip to content

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

fix(sql-editor): fixed the sheet api policy (#574)

Yunwei Xiao112b74fdbba2
diff --git a/api/sheet.go b/api/sheet.go
index fd5a1b7681..ef39f7b837 100644
--- a/api/sheet.go
+++ b/api/sheet.go
@@ -69,7 +69,7 @@ type SheetCreate struct {
// SheetPatch is the API message for patching a sheet.
type SheetPatch struct {
- ID int
+ ID int `jsonapi:"primary,sheetPatch"`
// Standard fields
// Value is assigned from the jwt subject field passed by the client.
@@ -80,9 +80,9 @@ type SheetPatch struct {
DatabaseID *int `jsonapi:"attr,databaseId"`
// Domain specific fields
- Name *string `jsonapi:"attr,name"`
- Statement *string `jsonapi:"attr,statement"`
- Visibility *SheetVisibility `jsonapi:"attr,visibility"`
+ Name *string `jsonapi:"attr,name"`
+ Statement *string `jsonapi:"attr,statement"`
+ Visibility *string `jsonapi:"attr,visibility"`
}
// SheetFind is the API message for finding sheets.
diff --git a/server/acl_casbin_policy_dba.csv b/server/acl_casbin_policy_dba.csv
index 54e4c0a940..663bcfeb7e 100644
--- a/server/acl_casbin_policy_dba.csv
+++ b/server/acl_casbin_policy_dba.csv
@@ -91,4 +91,5 @@ p, DBA, /sheet, POST
p, DBA, /sheet, GET
p, DBA, /sheet/{id}, GET
p, DBA, /sheet/{id}, PATCH
+p, DBA, /sheet/{id}, PATCH_SELF
p, DBA, /sheet/{id}, DELETE_SELF
diff --git a/server/acl_casbin_policy_developer.csv b/server/acl_casbin_policy_developer.csv
index 878dfc2886..f321abbc31 100644
--- a/server/acl_casbin_policy_developer.csv
+++ b/server/acl_casbin_policy_developer.csv
@@ -80,4 +80,5 @@ p, DEVELOPER, /sheet, POST
p, DEVELOPER, /sheet, GET
p, DEVELOPER, /sheet/{id}, GET
p, DEVELOPER, /sheet/{id}, PATCH
+p, DEVELOPER, /sheet/{id}, PATCH_SELF
p, DEVELOPER, /sheet/{id}, DELETE_SELF
diff --git a/server/acl_casbin_policy_owner.csv b/server/acl_casbin_policy_owner.csv
index 62999ce9e2..72d0d4f86b 100644
--- a/server/acl_casbin_policy_owner.csv
+++ b/server/acl_casbin_policy_owner.csv
@@ -97,4 +97,5 @@ p, OWNER, /sheet, POST
p, OWNER, /sheet, GET
p, OWNER, /sheet/{id}, GET
p, OWNER, /sheet/{id}, PATCH
+p, OWNER, /sheet/{id}, PATCH_SELF
p, OWNER, /sheet/{id}, DELETE_SELF