- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 11:35 PM
Hiii,
Can anyone please help us how to provide the access to view all incident templates to one particular user??
Currently user is able to see only his group templates.
Thanks,
LARA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 08:49 AM
Hi @LaraReddy
Certainly, we need the ACL to provide access to the record initially.
Regarding the OOTB business rule, customization is required.
Below is for the requirement custom role [temp_access] user able to see only incident related templates.
(function executeRule(current, previous /*null when async*/ ) {
if (gs.hasRole("temp_access")) {
current.addEncodedQuery('table=incident');
return;
}
roTemplates();
})(current, previous);
function roTemplates() {
var query = "global=true^ORuser=" + gs.getUserID() + "^ORgroups=javascript:gs.getUser().getMyGroups()";
current.addEncodedQuery(query);
}
If you want to grant access to all templates in the Incident table and also allow users to access templates shared with them, use the adjusted code below:
(function executeRule(current, previous /*null when async*/ ) {
roTemplates();
})(current, previous);
function roTemplates() {
var query = "global=true^ORuser=" + gs.getUserID() + "^ORgroups=javascript:gs.getUser().getMyGroups()";
if (gs.hasRole("temp_access")) {
query += '^ORtable=incident';
}
current.addEncodedQuery(query);
}
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 08:49 AM
Hi @LaraReddy
Certainly, we need the ACL to provide access to the record initially.
Regarding the OOTB business rule, customization is required.
Below is for the requirement custom role [temp_access] user able to see only incident related templates.
(function executeRule(current, previous /*null when async*/ ) {
if (gs.hasRole("temp_access")) {
current.addEncodedQuery('table=incident');
return;
}
roTemplates();
})(current, previous);
function roTemplates() {
var query = "global=true^ORuser=" + gs.getUserID() + "^ORgroups=javascript:gs.getUser().getMyGroups()";
current.addEncodedQuery(query);
}
If you want to grant access to all templates in the Incident table and also allow users to access templates shared with them, use the adjusted code below:
(function executeRule(current, previous /*null when async*/ ) {
roTemplates();
})(current, previous);
function roTemplates() {
var query = "global=true^ORuser=" + gs.getUserID() + "^ORgroups=javascript:gs.getUser().getMyGroups()";
if (gs.hasRole("temp_access")) {
query += '^ORtable=incident';
}
current.addEncodedQuery(query);
}
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 09:20 PM
Thanks, Tai, for your support.