MM-28530 - Changes are not automatically propagated to system console when a permission is added/removed from a role (#15562)
* send event for when role updates!!! * address PR comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
2af1bb7579
Коммит
a1e17fe78a
@@ -125,6 +125,8 @@ func (a *App) PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
a.sendUpdatedRoleEvent(role)
|
||||
|
||||
return role, err
|
||||
}
|
||||
|
||||
@@ -169,7 +171,7 @@ func (a *App) UpdateRole(role *model.Role) (*model.Role, *model.AppError) {
|
||||
model.CHANNEL_ADMIN_ROLE_ID,
|
||||
}
|
||||
|
||||
builtInRolesMinusChannelRoles := utils.RemoveStringsFromSlice(model.BuiltInSchemeManagedRoleIDs, builtInChannelRoles...)
|
||||
builtInRolesMinusChannelRoles := append(utils.RemoveStringsFromSlice(model.BuiltInSchemeManagedRoleIDs, builtInChannelRoles...), model.NewSystemRoleIDs...)
|
||||
|
||||
if utils.StringInSlice(savedRole.Name, builtInRolesMinusChannelRoles) {
|
||||
return savedRole, nil
|
||||
@@ -209,7 +211,9 @@ func (a *App) UpdateRole(role *model.Role) (*model.Role, *model.AppError) {
|
||||
}
|
||||
|
||||
for _, ir := range impactedRoles {
|
||||
a.sendUpdatedRoleEvent(ir)
|
||||
if ir.Name != role.Name {
|
||||
a.sendUpdatedRoleEvent(ir)
|
||||
}
|
||||
}
|
||||
|
||||
return savedRole, nil
|
||||
|
||||
Ссылка в новой задаче
Block a user