- 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 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-24-2024 12:31 AM
Why script this? What is the upside of scripting this, if you can easily set conditions to 'owned_by is dynamic me'. Just curious, since both should work, but conditions are less error prone (typos 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-21-2024 07:13 AM
Then you can do it as I already said: add a 'write' acl to your hardware table and add in the conditions part 'owned by' is dynamic 'me'. That will validate the table against the logged in user. Not sure why others are telling you to script, because these are simple conditions on the ACL record.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark