diff --git a/auth/group.go b/auth/group.go index 89ea66f..6636dab 100644 --- a/auth/group.go +++ b/auth/group.go @@ -24,11 +24,13 @@ type Group struct { UpdatedAt time.Time } +var BeforeGroupSave func(*Group) error = func(g *Group) error { return nil } + func (grp *Group) BeforeSave(tx *gorm.DB) (err error) { // set displayname if grp.DisplayName == "" { grp.DisplayName = strings.TrimPrefix(grp.Name, SYS_AUTH_PREFIX) } - return + return BeforeGroupSave(grp) }