Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2024 11:59 PM
How to use property that have multiple value in ACl,
i have created one property with string type and in value put Property1,Property 2
in an ACl write the below script
var valueProperty = gs.getProperty('property.write');
if (gs.hasRole('user_adv_admin')) {
answer = true;
} else if (gs.hasRole('itil') && valueProperty == current.getDisplayValue('u_property')) {
gs.addInfoMessage(valueProperty+"Table");
answer = false;
} else if (gs.hasRole('itil') && valueProperty != current.getDisplayValue('u_property')) {
answer = true;
}
Please let me know if i am doing the wrong way to pull value from property dynamically or what should be the correct way to pass property here if property has multiple value
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 12:07 AM
Hi @ABC6 Try this
var valueProperty = gs.getProperty('property.write');
var propertyValues = valueProperty ? valueProperty.split(',') : [];
if (gs.hasRole('user_adv_admin')) {
answer = true;
} else if (gs.hasRole('itil')) {
var currentPropertyValue = current.getDisplayValue('u_property');
if (propertyValues.indexOf(currentPropertyValue) !== -1) {
gs.addInfoMessage(currentPropertyValue + " Table");
answer = false;
} else {
answer = true;
}
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2024 12:07 AM
Hi @ABC6 Try this
var valueProperty = gs.getProperty('property.write');
var propertyValues = valueProperty ? valueProperty.split(',') : [];
if (gs.hasRole('user_adv_admin')) {
answer = true;
} else if (gs.hasRole('itil')) {
var currentPropertyValue = current.getDisplayValue('u_property');
if (propertyValues.indexOf(currentPropertyValue) !== -1) {
gs.addInfoMessage(currentPropertyValue + " Table");
answer = false;
} else {
answer = true;
}
}