ACL list persistence

0 votes
As I understand it, to creat a document with public read/write permissions, I would do the following:

HashSet<ACL> aclList = new HashSet<ACL>();
aclList.add(new ACL("PUBLIC", Permission.READ));
aclList.add(new ACL("PUBLIC", Permission.WRITE));
storageService.setAclList(aclList);

storageService.insertJSONDocument(...);

Now my question is: does that mean that every subsequent request I make on that same StorageService object will cause the document I am working with to have those permissions assigned to it?  If so, then I suppose this means I have to assign a new ACL set every time I make any request?  Or is it only certain types of requests that alter the document permissions?  For example, if I call .updateDocumentByDocId(), will the ACL list I have previously assigned affect the permissions of the document I am updating?  Or does the ACL list only affect newly created documents?

Thanks!
asked Jul 22, 2014 in App42PaaS & BPaaS by Brady Wright (35 points)

1 Answer

0 votes
 
Best answer

Hi Brady,

ACL permission works on insert and update operations. If during the update operation, ACL list is encountered on server side, it updates the ACL permission too at the same time. If you have same ACL permission as the time of insert, this is not going to impact your doc.

Also, if you want to have global ACL permission for all your data, you can just call App42API.SetDefaultACL(aclList) on startup of the app. In this case you dont have to pass the ACL list in service reference. If you do so, service reference ACL will be used to set the permission overriding the value of global ACL.

Let me know if it helps.

Thanks

Ajay

answered Jul 23, 2014 by ajay123 (899 points)
selected Jul 24, 2014 by Brady Wright
Thanks.  So in order to minimize API calls (since you pay based on the number of API calls made), should I locally "mirror" the ACL list and check it before setting a new list, so that I only set a new list when I actually need to change it from what it is currently set to?

I'm assuming that the current ACL list is set on a per-instance basis?  Is this a correct assumption?
Setting ACL along with operation not considered to be a separate call. It will be counted as one. Yes, if you set the ACL list it will be applicable to service instance.
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
...