Setting up Create, Read, Write and Delete ACL's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 05:29 PM
I've created a table called "Dream" I created a user role called Dream user to with the following ACL's: Create, Read, Write and Delete. I need the user to be able to create, delete and edit their own record but be able to read others. I created the following acl's but they don't work. Any assistance would be great.
Write ACL:
Create ACL:
Delete ACL:
Read ACL: has no script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2022 09:26 PM
Hi Andre,
Create and read ACL can have only role attached to it with no script. Create is executed only when a person creates a new record which is anyway of their own so it should be fine.
For create and delete add the required role on role section and in script try below
answer = false;
if (current.sys_created_by.equals(gs.getUserName()))
answer = true;
Regards,
Sateesh Kumar Devadoss
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 04:35 AM
Is there a condition to add? Because it didn't work
answer = false;
if (current.sys_created_by.equals(gs.getUserName()))
answer = true;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 06:36 AM
No condition need to be added.
can you mention which part is not working? State the Steps you are performing, actual result and expected result so that I can help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-11-2022 07:05 AM
I expect a user with either of these two roles x_380276_dreams.user, x_380276_dreams.admin, to be able to create a record on this table x_380276_dreams_dreams. They should be only able to delete or edit their own record and not others. They should also be able to read others created record.
This is what I have for delete admin role
Dream.user role delete ACL:
Those are just examples for delete and here is the script I'm using for both "Delete and Write"
answer = false;
if (current.sys_created_by.equals(gs.hasRole('x_380276_dreams.user')))
answer = true;