Skip to content

Commit 2ece63a

Browse files
pierwillsarahsimpersgssbzn
authored
DOCSP-29565: Add example using --inheritedRole to customDbRoles create (#1924)
Co-authored-by: pierwill <[email protected]> Co-authored-by: sarahsimpers <[email protected]> Co-authored-by: Gustavo Bazan <[email protected]>
1 parent 9d0fc0a commit 2ece63a

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

docs/atlascli/command/atlas-customDbRoles-create.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,11 @@ Examples
105105

106106
.. code-block::
107107

108+
# Create a custom database role
108109
atlas customDbRoles create customRole --privilege FIND@database,UPDATE@database
110+
111+
112+
.. code-block::
113+
114+
# Use an inherited role
115+
atlas customDbRoles create customRole --inheritedRole read@database

docs/mongocli/command/mongocli-atlas-customDbRoles-create.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,11 @@ Examples
105105

106106
.. code-block::
107107

108+
# Create a custom database role
108109
mongocli atlas customDbRoles create customRole --privilege FIND@database,UPDATE@database
110+
111+
112+
.. code-block::
113+
114+
# Use an inherited role
115+
mongocli atlas customDbRoles create customRole --inheritedRole read@database

internal/cli/atlas/customdbroles/create.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ func (opts *CreateOpts) validate() error {
8080
func CreateBuilder() *cobra.Command {
8181
opts := &CreateOpts{}
8282
cmd := &cobra.Command{
83-
Use: "create <roleName>",
84-
Short: "Create a custom database role for your project.",
85-
Long: fmt.Sprintf(usage.RequiredRole, "Project Owner"),
86-
Example: fmt.Sprintf(` %s customDbRoles create customRole --privilege FIND@database,UPDATE@database`, cli.ExampleAtlasEntryPoint()),
87-
Args: require.ExactArgs(1),
83+
Use: "create <roleName>",
84+
Short: "Create a custom database role for your project.",
85+
Long: fmt.Sprintf(usage.RequiredRole, "Project Owner"),
86+
Example: fmt.Sprintf(`# Create a custom database role
87+
%[1]s customDbRoles create customRole --privilege FIND@database,UPDATE@database
88+
89+
# Use an inherited role
90+
%[1]s customDbRoles create customRole --inheritedRole read@database`, cli.ExampleAtlasEntryPoint()),
91+
Args: require.ExactArgs(1),
8892
Annotations: map[string]string{
8993
"roleNameDesc": "Name of the custom role to create.",
9094
"output": createTemplate,

0 commit comments

Comments
 (0)