Mattermost-server: Port the "roles" command from Mattermost CLI to mmctl

Created on 29 Oct 2019  ·  12Comments  ·  Source: mattermost/mattermost-server

This ticket includes the creation of a “roles” command in mmctl with the following two subcommands:

  • member: removes system admin privileges from a user.
  • system_admin: sets a user as a system admin.

To achieve this, the commands should use the Update User Roles endpoint of the API. Both subcommands should mimic the structure, inputs and behavior of the Mattermost CLI implemented here.

Link to mmctl repository.

If you have questions about the ticket or you need any help, feel free to contact miguel.delacruz in https://community.mattermost.com/


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-19060

AreCLI Medium Hacktoberfest Help Wanted PR Exists TecGo

Most helpful comment

build succeeded with go1.13.3
thanks @hanzei

All 12 comments

May I have a go at this?

Sure. Thanks @akshaychhajed :+1:

@hanzei @mgdelacroix
make build fails for mattermost/mmctl with following error

go: github.com/mattermost/[email protected] requires
    willnorris.com/go/[email protected] requires
    cloud.google.com/[email protected] requires
    [email protected] requires
    google.golang.org/[email protected] requires
    google.golang.org/[email protected] requires
    github.com/golang/[email protected]: invalid pseudo-version: does not match version-control timestamp (2018-12-17T17:45:47Z)

In go.mod,

replace (
    git.apache.org/thrift.git => github.com/apache/thrift v0.0.0-20180902110319-2566ecd5d999
    // Workaround for https://github.com/golang/go/issues/30831 and fallout.
    github.com/golang/lint => github.com/golang/lint v0.0.0-20190227174305-8f45f776aaf1
)

Should github.com/golang/lint v0.0.0-20190227174305-8f45f776aaf1 be updated ?

I think you can just remove the two replace statements. There where there for legacy reasons.

Ok. let me try that.

now make fails for vet using shadow

# internal/cpu
flag provided but not defined: -unsafeptr
shadow: check for possible unintended shadowing of variables

Usage: shadow [-flag] [package]

......

this repeats for lot of packages

@hanzei why vet with shadow fails for -unsafeptr ?

What go version are you using?

looks like existing issue.
https://github.com/golang/go/issues/34053
I see you have commented here too.

go version go1.13.1
updating to go1.13.3 now.

build succeeded with go1.13.3
thanks @hanzei

Yes, I stumbled across this issue before.

Was this page helpful?
0 / 5 - 0 ratings