Skip to content

Commit 4922777

Browse files
DeadUnicorn1352Kyrylo Prokopchuk
and
Kyrylo Prokopchuk
authored
added xorm JSON struct tag to XormACLEntry (#388)
Co-authored-by: Kyrylo Prokopchuk <[email protected]>
1 parent 38e7252 commit 4922777

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

auth_server/authz/acl_xorm.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type XormAuthzConfig struct {
4343
type XormACL []XormACLEntry
4444

4545
type XormACLEntry struct {
46-
ACLEntry `xorm:"'acl_entry'"`
46+
ACLEntry `xorm:"'acl_entry' JSON"`
4747
Seq int64
4848
}
4949

@@ -138,8 +138,10 @@ func (xa *aclXormAuthz) updateACLCache() error {
138138
// Get ACL from Xorm.io database connection
139139
var newACL []XormACLEntry
140140

141-
xa.engine.OrderBy("seq").Find(&newACL)
142-
141+
err := xa.engine.OrderBy("seq").Find(&newACL)
142+
if err != nil {
143+
return err
144+
}
143145
var retACL ACL
144146
for _, e := range newACL {
145147
retACL = append(retACL, e.ACLEntry)

0 commit comments

Comments
 (0)