MM-10235: Make permissions reset CLI shcemes-aware. (#8773)
* MM-10235: Make permissions reset CLI shcemes-aware. * Add i18n strings.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d61f13d9b4
Коммит
a09dc68e1d
@@ -1772,3 +1772,11 @@ func (s SqlChannelStore) MigrateChannelMembers(fromChannelId string, fromUserId
|
||||
result.Data = data
|
||||
})
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) ResetAllChannelSchemes() store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
if _, err := s.GetMaster().Exec("UPDATE Channels SET SchemeId=''"); err != nil {
|
||||
result.Err = model.NewAppError("SqlChannelStore.ResetAllChannelSchemes", "store.sql_channel.reset_all_channel_schemes.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -282,3 +282,13 @@ func (s *SqlSupplier) SchemeGetAllPage(ctx context.Context, scope string, offset
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *SqlSupplier) SchemePermanentDeleteAll(ctx context.Context, hints ...store.LayeredStoreHint) *store.LayeredStoreSupplierResult {
|
||||
result := store.NewSupplierResult()
|
||||
|
||||
if _, err := s.GetMaster().Exec("DELETE from Schemes"); err != nil {
|
||||
result.Err = model.NewAppError("SqlSchemeStore.PermanentDeleteAll", "store.sql_scheme.permanent_delete_all.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -794,3 +794,11 @@ func (s SqlTeamStore) MigrateTeamMembers(fromTeamId string, fromUserId string) s
|
||||
result.Data = data
|
||||
})
|
||||
}
|
||||
|
||||
func (s SqlTeamStore) ResetAllTeamSchemes() store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
if _, err := s.GetMaster().Exec("UPDATE Teams SET SchemeId=''"); err != nil {
|
||||
result.Err = model.NewAppError("SqlTeamStore.ResetAllTeamSchemes", "store.sql_team.reset_all_team_schemes.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user