Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6246

Manipulate user objects exclusively via commands

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Done
    • None
    • 2.5.3
    • Security
    • None
    • Major Change

    Description

      Rather than using CRUD operations on db.system.users collections, user objects will be manipulated via commands:

      db.runCommand({
        createUser: 1,
        user: "spencer",
        password: "clear password",  // Unless "db" is "$external"
        extraData: <optional opaque Object>
        roles: [ { name: "roleName", db: "roleDB", canDelegate: <Boolean> }, ... ]
      });
       
      db.runCommand({
        updateUser: 1,
        user: "spencer",
        password: "new password clear",  // Optional
        extraData: <Object>, // Optional
      });
       
      db.runCommand({  deleteUser: 1, user: "spencer" });
       
      db.runCommand({
        grantRolesToUser: 1,
        user: "spencer",
        db: "somedb",  // Should this default to the db this command is targeted at?
        roles: [ { name: "roleName", db: "roleDB", canDelegate: <Boolean> }, ...]
      });
       
      db.runCommand({
        revokeRolesForUser: 1,  // Who can do this?
        user: "spencer",
        db: "somedb",  // Should this default to the db this command is targeted at?
        roles: [ { name: "roleName", db: "roleDB", canDelegate: <Boolean> }, ...]
      });
       
      db.runCommand({ usersInfo: 1, [userName: "spencer"] })

      Attachments

        Issue Links

          Activity

            People

              spencer@mongodb.com Spencer Brody (Inactive)
              spencer@mongodb.com Spencer Brody (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: