summaryrefslogtreecommitdiffstats
path: root/cmd/platform/roles.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/platform/roles.go')
-rw-r--r--cmd/platform/roles.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd/platform/roles.go b/cmd/platform/roles.go
index 1faf99d9e..ad64459e5 100644
--- a/cmd/platform/roles.go
+++ b/cmd/platform/roles.go
@@ -5,7 +5,6 @@ package main
import (
"errors"
- "github.com/mattermost/mattermost-server/app"
"github.com/spf13/cobra"
)
@@ -38,7 +37,8 @@ func init() {
}
func makeSystemAdminCmdF(cmd *cobra.Command, args []string) error {
- if err := initDBCommandContextCobra(cmd); err != nil {
+ a, err := initDBCommandContextCobra(cmd)
+ if err != nil {
return err
}
@@ -52,7 +52,7 @@ func makeSystemAdminCmdF(cmd *cobra.Command, args []string) error {
return errors.New("Unable to find user '" + args[i] + "'")
}
- if _, err := app.Global().UpdateUserRoles(user.Id, "system_admin system_user"); err != nil {
+ if _, err := a.UpdateUserRoles(user.Id, "system_admin system_user"); err != nil {
return err
}
}
@@ -61,7 +61,8 @@ func makeSystemAdminCmdF(cmd *cobra.Command, args []string) error {
}
func makeMemberCmdF(cmd *cobra.Command, args []string) error {
- if err := initDBCommandContextCobra(cmd); err != nil {
+ a, err := initDBCommandContextCobra(cmd)
+ if err != nil {
return err
}
@@ -75,7 +76,7 @@ func makeMemberCmdF(cmd *cobra.Command, args []string) error {
return errors.New("Unable to find user '" + args[i] + "'")
}
- if _, err := app.Global().UpdateUserRoles(user.Id, "system_user"); err != nil {
+ if _, err := a.UpdateUserRoles(user.Id, "system_user"); err != nil {
return err
}
}