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 `users` 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 sub commands.", 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: "`users list` 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" + "```\ncatalyze -E \"<your_env_alias>\" users list\n```", 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(true, true, 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: "`users rm` 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" + "```\ncatalyze -E \"<your_env_alias>\" users rm user@example.com\n```", 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(true, true, 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.