- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 11:19 AM
I have to configure write ACL to specific field on the Stockroom Table. This "write" permission should be assined to the "Stockroom Manager (sys_user)" field.
@Ankur Bawiskar @Community Alums could you please suggest.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 11:24 AM - edited 07-25-2024 11:30 AM
Hi @abhijeet khale ,
You can write business rule for the same.
If logges_in user == Stockroom Manager , then only it will allow to save any changes.
Or You can apply the same logic in ACL script section, something like this.
// Get the current stockroom record
var gr = new GlideRecord('alm_stockroom');
if (gr.get(current.sys_id)) {
// Check if the current user is the stockroom manager
if (gr.manager == gs.getUserID()) {
// Allow access
answer = true;
} else {
// Deny access
answer = false;
}
} else {
// Deny access if record is not found
answer = false;
}
Thanks.
Hope it helps.
Mark it helpful and accept solution if my response turns useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 11:24 AM - edited 07-25-2024 11:30 AM
Hi @abhijeet khale ,
You can write business rule for the same.
If logges_in user == Stockroom Manager , then only it will allow to save any changes.
Or You can apply the same logic in ACL script section, something like this.
// Get the current stockroom record
var gr = new GlideRecord('alm_stockroom');
if (gr.get(current.sys_id)) {
// Check if the current user is the stockroom manager
if (gr.manager == gs.getUserID()) {
// Allow access
answer = true;
} else {
// Deny access
answer = false;
}
} else {
// Deny access if record is not found
answer = false;
}
Thanks.
Hope it helps.
Mark it helpful and accept solution if my response turns useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 08:15 PM
so please share what did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2024 10:21 PM
Thank you for quick response Ankur. My query has been resolved.