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

grantPrivilegesToRole and revokePrivilegesFromRole should reject privileges with no actions

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.5
    • Affects Version/s: 2.5.3
    • Component/s: Security
    • Labels:
    • ALL

      > var noActionsPriv = { resource:

      { db: "", collection: "" }

      , actions: [] };

      > db.runCommand(

      { grantPrivilegesToRole: "roleName", privileges: [ noActionsPriv ] }

      );
      > db.runCommand(

      { revokePrivilegesFromRole: "roleName", privileges: [ noActionsPriv ] }

      );

      This is a bug for the sake of consistency with other privilege-related commands. For example, the createRole() command will fail if you pass in a privilege with an empty 'actions' array. These commands require at least one specified action in order to succeed.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: