Skip to content

Commit

Permalink
added xorm JSON struct tag to XormACLEntry (#388)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyrylo Prokopchuk <kyrylo.prokopchuk@quest.com>
  • Loading branch information
DeadUnicorn1352 and Kyrylo Prokopchuk authored Jun 6, 2024
1 parent 38e7252 commit 4922777
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 4922777

Please sign in to comment.