script to check user against field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 01:27 PM
Excuse my likely incorrect terminology... I haven't looked at JS in years. I'm trying to lock down asset records so only the assigned property custodian can edit (with the exception of the Comments field which I want to remain writable by anyone).
I know the getUserID() method will call the sys_id of the current User and I can check that against the sys_id of the alm_asset.custodian field and return TRUE if they match.
If that all sounds feasible, what's the actual script? Or, even better, is there a non-script solution for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2024 03:25 AM
Did you also check on existing ACL's? If there are any in there that allow for everyone to write, you need to inactivate those as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2024 07:07 AM
Confirm the record you are testing is actually on the same table as the ACL. I used alm_asset in my example, but maybe it's alm_hardware... You can see the table name in the URL, or right-click on the header and choose Configure > Table. Also confirm that 'custodian' is the correct field name, and that's it's actually on that table, not on the form dot-walked from a related field.