- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 09:49 AM
I need to provide write access to hardware table based on owned by field. Could you please assist me on this.
Regards,
Ashok.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 07:35 PM
Hi @Ashok59 ,
You can achieve this by creating a write ACL on alm_asset table with None.
U need to select advanced & under script section u can write this script
if (current.owned_by == gs.getUserID()){
answer = true;
}
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 11:32 PM
Hello @Ashok59 ,
You can give a try to the script below in the write ACL on alm_asset table,
var ownedByUser = current.owned_by.user; // Assuming 'owned_by' is a reference field to the User table
if (ownedByUser == gs.getUserID()) {
answer = true;
} else {
answer = false;
}
If, despite using the script above, you are still facing issues with access, it's advisable to investigate existing ACLs on the write function that might be conflicting with your new one. Additionally, you can leverage the "Debug Security Rules" feature to identify all ACLs running on the current record. This can help pinpoint any conflicts or interactions between different rules and guide you in resolving the access-related challenges effectively.
This version provides a more detailed explanation of the suggested script and offers additional guidance on troubleshooting and debugging potential conflicts with existing ACLs.
Let me know your views on this and Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 10:01 AM
Without more information, I assume that there already is read access to the hardware table? Because this could have license impact if not.
Write access can be granted by creating a write ACL and add to the condition field (not via script, which I came across a couple of times the past couple of days): 'owned by' is dynamic 'me'.
Do limit it to certain fields. You don't want someone to change serial numbers and such.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 05:54 PM
I assume that there already is read access to the hardware table? - yes, we have read access with ITIL role.
my requirement -
I should provide write access to hardware table records when current logged in user name and owned by field name matches. Could you please assist me on this asap and let me know if required more info.
Regards,
Ashok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 05:53 PM
I assume that there already is read access to the hardware table? - yes, we have read access with ITIL role.
my requirement -
I should provide write access to hardware table records when current logged in user name and owned by field name matches. Could you please assist me on this asap and let me know if required more info.
Regards,
Ashok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2024 07:35 PM
Hi @Ashok59 ,
You can achieve this by creating a write ACL on alm_asset table with None.
U need to select advanced & under script section u can write this script
if (current.owned_by == gs.getUserID()){
answer = true;
}
Thanks,
Danish