Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-7631

Document the showPrivileges option to the connectionStatus command

    XMLWordPrintableJSON

Details

    • 0.25

    Description

      The page for the connectionStatus command (https://docs.mongodb.org/manual/reference/command/connectionStatus/) does not mention the showPrivileges: true option. This option provides valuable extra information about the privileges that are associated with the roles of logged-in users.

      > db.runCommand({ connectionStatus:1})
      {
              "authInfo" : {
                      "authenticatedUsers" : [
                              {
                                      "user" : "onlyFind",
                                      "db" : "test"
                              }
                      ],
                      "authenticatedUserRoles" : [
                              {
                                      "role" : "onlyFind",
                                      "db" : "test"
                              }
                      ]
              },
              "ok" : 1
      }
      > db.runCommand({ connectionStatus:1, showPrivileges: true})
      {
              "authInfo" : {
                      "authenticatedUsers" : [
                              {
                                      "user" : "onlyFind",
                                      "db" : "test"
                              }
                      ],
                      "authenticatedUserRoles" : [
                              {
                                      "role" : "onlyFind",
                                      "db" : "test"
                              }
                      ],
                      "authenticatedUserPrivileges" : [
                              {
                                      "resource" : {
                                              "db" : "test",
                                              "collection" : "test"
                                      },
                                      "actions" : [
                                              "find"
                                      ]
                              }
                      ]
              },
              "ok" : 1
      }
      

      Attachments

        Activity

          People

            allison.moore@mongodb.com Allison Reinheimer Moore
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              7 years, 25 weeks, 1 day ago