From 4922777603d8abee66d673b3f99a8beea760e311 Mon Sep 17 00:00:00 2001 From: DeadUnicorn1352 <74927006+DeadUnicorn1352@users.noreply.github.com> Date: Thu, 6 Jun 2024 23:27:48 +0200 Subject: [PATCH] added xorm JSON struct tag to XormACLEntry (#388) Co-authored-by: Kyrylo Prokopchuk --- auth_server/authz/acl_xorm.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/auth_server/authz/acl_xorm.go b/auth_server/authz/acl_xorm.go index f60af213..559b4bc7 100644 --- a/auth_server/authz/acl_xorm.go +++ b/auth_server/authz/acl_xorm.go @@ -43,7 +43,7 @@ type XormAuthzConfig struct { type XormACL []XormACLEntry type XormACLEntry struct { - ACLEntry `xorm:"'acl_entry'"` + ACLEntry `xorm:"'acl_entry' JSON"` Seq int64 } @@ -138,8 +138,10 @@ func (xa *aclXormAuthz) updateACLCache() error { // Get ACL from Xorm.io database connection var newACL []XormACLEntry - xa.engine.OrderBy("seq").Find(&newACL) - + err := xa.engine.OrderBy("seq").Find(&newACL) + if err != nil { + return err + } var retACL ACL for _, e := range newACL { retACL = append(retACL, e.ACLEntry)