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

read only in 2.2

    XMLWordPrintableJSON

Details

    • Icon: Question Question
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • None
    • None
    • Windows 32

    Description

      I tried testing the read only user on the new mongodb version and I can not not get read-only to work. I did this test on my PC, and not in our real production environment.Here is my test. Firt I started mongo, and create an admin user "george". Then I restarted mongod with the --auth option.
      C:\mongoDB\mongodb-win32-i386-2.2.0\bin>mongo
      MongoDB shell version: 2.2.0
      connecting to: test
      > use admin
      switched to db admin
      > db.auth("george","george")
      1
      > use ops
      switched to db ops
      > db.addUser("geo","geo",true)

      { "_id" : ObjectId("5050efac7e688079cf00fdbd"), "user" : "geo", "readOnly" : true, "pwd" : "54f4620002480121e1f23b0d293e0fe6" } > db.auth("geo","geo") 1 > db.ll.find() { "_id" : ObjectId("5050ef8f7e688079cf00fdbc"), "fname" : "George" } { "_id" : ObjectId("5050efe37e688079cf00fdbe"), "fname" : "George test read onl" } { "_id" : ObjectId("5050f1850305681475bd79d6"), "fname" : "George test read onl TWO" } { "_id" : ObjectId("5050fdefcd812110fa0466aa"), "fname" : "One" }

      > db.ll.save(

      {fname:"Two"}

      )
      > db.ll.find()

      { "_id" : ObjectId("5050ef8f7e688079cf00fdbc"), "fname" : "George" } { "_id" : ObjectId("5050efe37e688079cf00fdbe"), "fname" : "George test read onl" } { "_id" : ObjectId("5050f1850305681475bd79d6"), "fname" : "George test read onl TWO" } { "_id" : ObjectId("5050fdefcd812110fa0466aa"), "fname" : "One" } { "_id" : ObjectId("505101cd7b5e3666d16d154e"), "fname" : "Two" }

      > exit
      bye

      It should not let me save the "Two" right?

      Thanks

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: