currentUser.hasRole('u_dmn_cost_vendor_exempt') Line is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2025 05:01 AM
Hi Team,
For Demands under Cost Plan tab. we return logic for users to view the cost plans.
1. If user is vendor they can't able to view Cost plan. This is working expected.
2. If user is vendor and user having u_dmn_cost_vendor_exempt role. Then they can able to view. This behaviour is not working.
We have a read ACL for this :-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2025 10:32 AM
and two read ACL:-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 02:03 AM
@thaduri sai Picture is not clear..please share the clear picture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2025 11:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2025 02:16 AM
@thaduri sai try the below and see..
checkVendorAccessToCostPlan: function(costTypeCompany) {
var companyId = gs.getUser().getRecord().getValue('company');
var currentCompany = new GlideRecord('core_company');
currentCompany.get(companyId);
if (currentCompany.hasNext()) {
if (currentCompany.vendor) {
//is lead SD or is collborator or part of assignment group of demand task
//gs.log("****** assignmentGroup" + current.u_demand_task.assignment_group.name );
if (current.task.assigned_to == gs.getUserID() || current.task.collaborators.includes(gs.getUserID()) || current.task.u_collaborators.includes(gs.getUserID()) || gs.getUser().isMemberOf(current.u_demand_task.getDisplayValue('assignment_group'))) {
//for vendors - check if vendor company matches cost type company, or cost type company is empty (in case of fixed cost type)
//gs.log("gethere1 currentCompany.name: "+currentCompany.name);
if (currentCompany.sys_id == costTypeCompany || costTypeCompany == '') {
//gs.log("gethere2");
return true;
} else if (gs.hasRole('u_dmn_cost_vendor_exempt')) { //allow to see cost
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return true;
}
}else {
return true;
}
},