summaryrefslogtreecommitdiffstats
path: root/app/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/app.go b/app/app.go
index 6de75855c..e5a496c6b 100644
--- a/app/app.go
+++ b/app/app.go
@@ -20,6 +20,7 @@ import (
"github.com/mattermost/mattermost-server/einterfaces"
ejobs "github.com/mattermost/mattermost-server/einterfaces/jobs"
"github.com/mattermost/mattermost-server/jobs"
+ tjobs "github.com/mattermost/mattermost-server/jobs/interfaces"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/plugin/pluginenv"
@@ -93,6 +94,8 @@ type App struct {
clientConfig map[string]string
clientConfigHash string
diagnosticId string
+
+ phase2PermissionsMigrationComplete bool
}
var appCount = 0
@@ -321,6 +324,12 @@ func RegisterJobsLdapSyncInterface(f func(*App) ejobs.LdapSyncInterface) {
jobsLdapSyncInterface = f
}
+var jobsMigrationsInterface func(*App) tjobs.MigrationsJobInterface
+
+func RegisterJobsMigrationsJobInterface(f func(*App) tjobs.MigrationsJobInterface) {
+ jobsMigrationsInterface = f
+}
+
var ldapInterface func(*App) einterfaces.LdapInterface
func RegisterLdapInterface(f func(*App) einterfaces.LdapInterface) {
@@ -415,6 +424,9 @@ func (a *App) initJobs() {
if jobsLdapSyncInterface != nil {
a.Jobs.LdapSync = jobsLdapSyncInterface(a)
}
+ if jobsMigrationsInterface != nil {
+ a.Jobs.Migrations = jobsMigrationsInterface(a)
+ }
}
func (a *App) DiagnosticId() string {
@@ -580,3 +592,14 @@ func (a *App) DoAdvancedPermissionsMigration() {
mlog.Critical(fmt.Sprint(result.Err))
}
}
+
+func (a *App) SetPhase2PermissionsMigrationStatus(isComplete bool) error {
+ if !isComplete {
+ res := <-a.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2)
+ if res.Err != nil {
+ return res.Err
+ }
+ }
+ a.phase2PermissionsMigrationComplete = isComplete
+ return nil
+}