Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = models.Command{ Name: "users", ShortHelp: "Manage users who have access to the given organization", LongHelp: "The <code>users</code> command allows you to manage who has access to your environment through the organization that owns the environment. " + "The users command can not be run directly but has three subcommands.", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(cmd *cli.Cmd) { cmd.CommandLong(ListSubCmd.Name, ListSubCmd.ShortHelp, ListSubCmd.LongHelp, ListSubCmd.CmdFunc(settings)) cmd.CommandLong(RmSubCmd.Name, RmSubCmd.ShortHelp, RmSubCmd.LongHelp, RmSubCmd.CmdFunc(settings)) } }, }
Cmd is the contract between the user and the CLI. This specifies the command name, arguments, and required/optional arguments and flags for the command.
View Source
var ListSubCmd = models.Command{ Name: "list", ShortHelp: "List all users who have access to the given organization", LongHelp: "<code>users list</code> shows every user that belongs to your environment's organization. " + "Users who belong to your environment's organization may access to your environment's services and data depending on their role in the organization. " + "Here is a sample command\n\n" + "<pre>\ndatica -E \"<your_env_name>\" users list\n</pre>", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(subCmd *cli.Cmd) { subCmd.Action = func() { if _, err := auth.New(settings, prompts.New()).Signin(); err != nil { logrus.Fatal(err.Error()) } if err := config.CheckRequiredAssociation(settings); err != nil { logrus.Fatal(err.Error()) } err := CmdList(settings.UsersID, New(settings), invites.New(settings)) if err != nil { logrus.Fatal(err.Error()) } } } }, }
View Source
var RmSubCmd = models.Command{ Name: "rm", ShortHelp: "Revoke access to the given organization for the given user", LongHelp: "<code>users rm</code> revokes a users access to your environment's organization. " + "Revoking a user's access to your environment's organization will revoke their access to your organization's environments. " + "Here is a sample command\n\n" + "<pre>\ndatica -E \"<your_env_name>\" users rm user@example.com\n</pre>", CmdFunc: func(settings *models.Settings) func(cmd *cli.Cmd) { return func(subCmd *cli.Cmd) { email := subCmd.StringArg("EMAIL", "", "The email address of the user to revoke access from for the given organization") subCmd.Action = func() { if _, err := auth.New(settings, prompts.New()).Signin(); err != nil { logrus.Fatal(err.Error()) } if err := config.CheckRequiredAssociation(settings); err != nil { logrus.Fatal(err.Error()) } err := CmdRm(*email, New(settings)) if err != nil { logrus.Fatal(err.Error()) } } subCmd.Spec = "EMAIL" } }, }
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.