I'm new with CouchDB. I don't know if I can restrict the fields that a role can read from a document. If I can, is this the right approach to work with CouchDB?
For example, if I have a document like this:
{
firstname: 'firstname',
lastname: 'lastname',
email: ['home': 'foobar@foobar.net', 'work': 'foobar@foobar-working.net'],
phone: ['home': '+81 00 0000 0000'],
}
And the following roles:
{
"admins": {
"names": [
"superuser"
],
"roles": [
"admins"
]
},
"members": {
"names": [
"user1",
"user2"
],
"roles": [
"developers"
]
}
}
I want that admin roles can read all the fields while developers can read only email and phone. How can I achieve this? Using validation functions?