Skip to content

Commit

Permalink
added xorm JSON struct tag to XormACLEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrylo Prokopchuk committed Mar 19, 2024
1 parent 38e7252 commit 02193b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions auth_server/authz/acl_xorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type XormAuthzConfig struct {
type XormACL []XormACLEntry

type XormACLEntry struct {
ACLEntry `xorm:"'acl_entry'"`
ACLEntry `xorm:"'acl_entry' JSON"`
Seq int64
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 02193b5

Please sign in to comment.