grantPrivilegesToRole and revokePrivilegesFromRole should reject privileges with no actions

XMLWordPrintableJSON

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

      > 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 Brody (Inactive)
            Reporter:
            Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: