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

Manipulate user objects exclusively via commands

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.3
    • Component/s: Security
    • Labels:
      None
    • Backwards Compatibility:
      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

              Assignee:
              spencer Spencer Brody (Inactive)
              Reporter:
              spencer Spencer Brody (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: