master
Evan Chen 2021-12-19 03:15:32 +08:00
parent a84c90f459
commit 337f2e910b
1 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ func ApiGrpUpdate(c *gin.Context) {
if strings.HasPrefix(grp.Name, SYS_AUTH_PREFIX) { if strings.HasPrefix(grp.Name, SYS_AUTH_PREFIX) {
panic(errors.ErrorForbidden) panic(errors.ErrorForbidden)
} }
if !ACHas(c, ADMIN, grp.Name) { if !ACHas(c, ADMIN, grp.Name, SYSTEM) {
panic(errors.ErrorForbidden) panic(errors.ErrorForbidden)
} }
result := DB.Model(&grp).Updates(map[string]interface{}{ result := DB.Model(&grp).Updates(map[string]interface{}{
@ -86,8 +86,8 @@ func ApiGrpUpdate(c *gin.Context) {
if result.Error != nil { if result.Error != nil {
panic(result.Error) panic(result.Error)
} }
if fetch != "" { if fetch != "" && ACHas(c, ADMIN, SYSTEM) {
DB.Preload("Users").First(grp, data.ID) DB.Preload("Users").Preload("Users.Profile").First(grp, data.ID)
} }
history.Send(history.Info().Nm("Update"). history.Send(history.Info().Nm("Update").
Bd(data).Grp(data.Name).Scp("grp"). Bd(data).Grp(data.Name).Scp("grp").