From 51bd710ecdca6628461c9fa2679737073e4d5059 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Mon, 14 May 2018 15:59:04 +0100 Subject: MM-9728: Online migration for advanced permissions phase 2 (#8744) * MM-9728: Online migration for advanced permissions phase 2 * Add unit tests for new store functions. * Move migration specific code to own file. * Add migration state function test. * Style fixes. * Add i18n strings. * Fix mocks. * Add TestMain to migrations package tests. * Fix typo. * Fix review comments. * Fix up the "Check if migration is done" check to actually work. --- app/scheme.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/scheme.go') diff --git a/app/scheme.go b/app/scheme.go index b43914eb8..a8eb9ef46 100644 --- a/app/scheme.go +++ b/app/scheme.go @@ -3,7 +3,9 @@ package app -import "github.com/mattermost/mattermost-server/model" +import ( + "github.com/mattermost/mattermost-server/model" +) func (a *App) GetScheme(id string) (*model.Scheme, *model.AppError) { if result := <-a.Srv.Store.Scheme().Get(id); result.Err != nil { @@ -109,7 +111,9 @@ func (a *App) GetChannelsForScheme(scheme *model.Scheme, offset int, limit int) } func (a *App) IsPhase2MigrationCompleted() *model.AppError { - // TODO: Actually check the Phase 2 migration has completed before permitting these actions. + if result := <-a.Srv.Store.System().GetByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2); result.Err != nil { + return result.Err + } return nil } -- cgit v1.2.3-1-g7c22