Who can access a 'Saving Additional Data along with User' json doc

0 votes
When saving additional data with a user a json doc is created. In the example the username is used as the doc name. Its not clear who has access to that document, just the user or anyone who requests that doc by username.do any acl permissions need to be set or is that done automatically. Also when using data storage commands, is access to these docs automatically restricted to the user or are they public by default? PS. Thanks for the quick response in updating the js docs.
asked Oct 27, 2015 in App42 Cloud API-BaaS by dennis.asher (13 points)

1 Answer

+1 vote

Hello Dennis,

In the documentation, the following code snippet is used to create the jsonDoc:

    var jsonDoc = new Object();  

    jsonDoc.name = "Nick";  //It can be anything like users first name

    jsonDoc.type = "30";  

Here the name is not the doc name, it is the extra info about the user in the key-value pair which will be saved for the user  as follows:

    {"name":"Nick","type":30}

This info can be accessed by associating the query along with the getUser API call as shown in the Fetch Additionla data code snippet.

Also, permssions on decoument created along with user creation is depend on the App permission which you have choosed at the time of App creation in case of ACL app. If its Public Read then all users can access this information from Storage Service, but they don't have rights to update it. If it is Public Write or All, then anybody can access and update that data using their session id.

If you don't want to provide access to read or write to publiic users, then you can simply call RevokeAccessOnDoc function from storage service and revoke the permissions. Please have a look at this link for the code snippet and let me know if it helps.

Thanks.

answered Oct 28, 2015 by rajeev.etc (1,660 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...