- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 11:00 AM
Hello,
I have a new field I have created on the user table. This field will only be able to be written to by Admins and through a record producer we have on our portal (record producer does not create record, it does update). I need an ACL that only allows Admin to write too. I have a custom role that will only have read access. If a user is trying to update their record from the back-end on the user table, they should also have access.
Currently, I have everything setup. I have a write ACL for Admin only, so no other users can make modifications. Now I need to add something that will allow current users to make modifications to their own records.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 11:13 AM
You can add following code in acl script
if (!gs.hasRole('admin')&& gs.getUserID() !== current.getValue('some user field on record')) {
answer = false;
} else {
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 11:13 AM
You can add following code in acl script
if (!gs.hasRole('admin')&& gs.getUserID() !== current.getValue('some user field on record')) {
answer = false;
} else {
answer = true;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 11:30 AM
If I wanted to make it read only for a particular role how can I do that?
if(gs.hasRole('update_contact_info')) {
answer = false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 11:37 AM
create a read acl and dont write acl for this role.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 09:21 AM
@mkader, did you tried above script to provide write access to user on their own assets. Is it working?
Please share your response asap, little urgent for me.
Thank you,
Ashok.