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

grantPrivilegesToRole and revokePrivilegesFromRole should reject empty 'privileges' argument

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.5
    • 2.5.3
    • Security
    • ALL

    Description

      > db.runCommand(

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

      )
      > db.runCommand(

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

      )

      expect commands to fail, because 'privileges' array is empty. Instead, get

      { "ok" : 1 }

      This is a bug for the sake of consistency with other role-related commands. For example, the grantRoleToRole() and grantRoleToUser() commands will fail if you pass an empty 'roles' array to either. These commands require at least one specified granted role in order to succeed.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: