isNewRecord() not working in ACL with REST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2016 09:20 AM
Hi,
I need an account to create records but also be restricted to Read with just new records.
In the table Read ACL, I've added if(current.isNewRecord() && gs.hasRole(XXX)){ answer = true;}
But it's not working when I go to the REST API Explorer to test. I am not able to add any Fields to the Parameter.
Are you able to use isNewRecord with REST API? Is there a way to do this? We basically don't want this account to be able to GET records back that was opened by it but still be able to create. And it looks like it needs read to create.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2016 10:56 AM
The ACLs processing order is well documented over here:
I hope this helps!
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2016 11:12 AM
Sorry I'm still confused about the first part..
Don't I need read role for this account to use the create operation? And if I give it the read role then doesn't it have access to all records to that table? We don't want it to have access to all records just ones that this account opened.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2016 11:49 AM
Hi Phuong,
I'm almost sure that you don't need a read access in order to do a create operation. Best way is to try it out with a new table, a new role and take a look how it responds given those ACL conditions
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2016 11:51 AM
If the account does require to have read access to the records it created then you can use the sys_created_by field and have a specific ACL if the created by matches with your REST account
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2016 08:21 AM
I did test it out and it does require read access. I also tested with using sys_created_by field in a specific ACL and it will give the account access to records that account created but also to ALL other records. We don't want this account to view the other records. Is there a way to do this? Or am I missing something?