I'm trying to filter my collection of documents according to the users who logs in. I followed the instructions for auth given by the people of cloudant.com , I created an _user db and it works.
Now my question is: is it possible to add some ad-hoc key to the user object and retrieve it from my code, with some js plugin like jquery.couchLogin?
example of what I want to create:
{
"_id": "org.couchdb.user:agata",
"_rev": "1-03a67c25da054b5f24d215f4db059d71",
"name": "agata",
"type": "user",
"roles": ["admin"],
"password_sha": "***",
"salt": "***",
"MYKEY1":"my val",
"MYKEY2":"my val2"
}
and then retrieve MYKEY1 AND MYKEY2....
I already tried with $.couchLogin but all I can retrieve is a userCtx object which reports only some of the above fields (name, roles). It seems that I should trick with the couchdb code to add keys to the userCtx object, and I really don't want to.
Is there a simplier solution?