1

How is this even possible? What am I missing?...

Non-sense query denial

Edit 1: Ignore the db.posts.find vs. db.post.find typo above. I re-auth'd and tried the latter and get exact same denial.

Am I dumb or do MongoDb permissions make no sense at all? Ok don't answer that first part ;-)

Thanks a lot for any advice, I'm stuck on this one.

Sylvain Leroux
  • 50,096
  • 7
  • 103
  • 125
Locohost
  • 1,682
  • 5
  • 25
  • 38

2 Answers2

0

You grant only roles to the db admin. Not on d6games-site.

Try using:

db.grantRolesToUser(
  "webuser",
  [
    { role: "readWrite", db: "d6games-site" } ,
  ]
)

and very probably:

db.revokeRolesFromUser(
    "webuser",
    [
      { role: "readWrite", db: "admin" }
    ]
)
Sylvain Leroux
  • 50,096
  • 7
  • 103
  • 125
  • Ok I think this finally gets me sorted out... The trick is, in Mongo shell, *always* do "use admin" before creating and/or granting/revoking *permissions to any user in **any db***. In the JSON "db" attrib, specify the actual db you want to give this user permission in. @Sylvain: Do I understand it now? :-) – Locohost May 06 '15 at 17:26
  • @Locohost Correct. You need the [userAdmin](http://docs.mongodb.org/manual/reference/built-in-roles/#userAdmin) role to grant/revoke permissions. To check the current user's permission, you may use `db.runCommand({connectionStatus : 1})` – Sylvain Leroux May 06 '15 at 20:41
0

The problem is that your table is 'post' and in query you use 'posts'. Try db.post.find()

styvane
  • 59,869
  • 19
  • 150
  • 156
andy
  • 51
  • 1
  • 5
  • No I saw that typo immediately and retried using db.post. See the Edit 1 in OP. Thank you though. I appreciate the reply. – Locohost May 06 '15 at 17:09