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