- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 06:31 PM - edited 05-09-2024 01:46 AM
Hi! I have a custom table that contains records for repair requests. Using a business rule, I had made A Before Query rule that only displays records made by the currently logged in user with this script:
(function executeRule(current, previous /*null when async*/ ) {
current.addQuery('sys_created_by', gs.getUser().getName());
})(current, previous);
This achieves my goal of hiding records from other users, but wouldn't this make it such that admins accessing the table list will also be only be able to see records created by them? Is there a more elegant solution? Perhaps an ACL? If so, how should I go about it? Any guidance on the matter would be appreciated.
Edit: My solution instead was to doing an ACL instead and putting a filter on the List of Records Link Type application module like Maik suggested
ACL
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2024 08:36 PM
Your question "Is there a more elegant solution?" cannot be answered as you did not explain the reason for your approach. What is the underlying requirement?
To solve your concern regarding admin access, you could add the following:
(function executeRule(current, previous /*null when async*/ ) {
if (!gs.hasRole('admin')) {
current.addQuery('sys_created_by', gs.getUser().getName());
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2025 10:37 PM
hey what if it affecting approvals in portal