I'm testing out the recently released DocumentDb and can't find any documentation indicating best practice on how to perform user data segregation.
I imagine the rough design would be:
- Authenticate the user and create new/obtain existing user id
- On document insert inject the user id into the document
- On read of document/collection of documents query where document user id = current user id
I'm creating an AngularJs application and currently use an Azure Sql Database combined with Azure Mobile Services.
Mobile services handles the user authentication and also the server side user data segregation by the use of data script javascript functions:
e.g.
function insert(item, user, request) {
item.userId = user.userId;
request.execute();
}
Any suggestions on what would be the technique for secure user data segregation from AngularJS using DocumentDB?