Hi Team,
We have created filterString in the form and below is the reference. We noticed few users are getting restricted in the Identity Filter field since logged in user does not authorise since scoping is implemented. In this case we wanted to
all the user irrespective of scoping. Please help on the beanshell coding while developing the form.
f1 =Filter.eq("identityType","Employee");
f2 =Filter.eq("appointmentType","K");
f4= Filter.eq("inactive",false);
f5 =Filter.eq("identityType","Special");
f6 =Filter.eq("identitySubType","Over");
f3 = Filter.or(Filter.and(f1,f2,f4), Filter.and(f5,f6,f4));
field.setFilterString(f3.toString());
Hello @kolipakularaviturnkey ,
Could you please give more details of your requirement? You want all user to access this form, irrespective of which scope they belong to?
or you want all users to be displayed in the Identity field of the Form/Quicklink?
Hi @kolipakularaviturnkey ,
You can try using “qo.setScopeResults(false);” and let me know if it works for you.
to display all users in the identityField of the form ignoring the scoping
I understand
how to add over here queryOptions inside filterString? can you throw some light?
<entry key="filterString">
import sailpoint.object.*;
log.error(“dscRole…”+ dscRole);
Identity requester=context.getObjectByName(Identity.class,launcher);
log.error(“dscRole”+ dscRole);
log.error(“requester”+ requester.getName());
Filter f1, f2, f3, f4, f5, f6;
f1 =Filter.eq(“identityType”,“HR Managed Employee”);
f2 =Filter.eq(“appointmentType”,“S”);
f4= Filter.eq(“inactive”,false);
f5 =Filter.eq(“identityType”,“Special ID”);
f6 =Filter.eq(“identitySubType”,“Overseas”);
f3 = Filter.or(Filter.and(f1,f2,f4), Filter.and(f5,f6,f4));
field.setFilterString(f3.toString());
Below are two approaches you can try
Option 1:
<Field displayName="Users" displayType="combobox" name="users" postBack="true" required="true" type="sailpoint.object.Identity">
<Attributes>
<Map>
<entry key="filterString">
<value>
<Script>
<Source>
<![CDATA[
import sailpoint.object.Filter;
Filter filter = Filter.ignoreCase(Filter.eq("inactive", false));
form.getField("users").setFilterString(filter.toString());
return filter.toString();
]]>
</Source>
</Script>
</value>
</entry>
</Map>
</Attributes>
</Field>
Option 2:
<Configuration name="IdentitySelectorConfiguration">
<Attributes>
<Map>
<entry key="identityFilters">
<value>
<Map>
<!-- entry start -->
<entry key="FormNameHere-form-FieldNameHere-field">
<value>
<IdentityFilter ignoreGlobal="true" name="Global" order="Ascending">
<FilterScript>
<Script>
<Source>
<![CDATA[
// Sample Code
import sailpoint.object.Filter;
import sailpoint.object.QueryOptions;
QueryOptions ops = new QueryOptions();
List filter = new ArrayList();
filter.add(Filter.ignoreCase(Filter.eq("cataffiliationcode", "001")));
filter.add(Filter.ignoreCase(Filter.eq("inactive", false)));
filter.add(Filter.isnull("cataliastype"));
ops.addFilter(Filter.and(filter));
// also filter by user input
ops.addFilter (Filter.or (
Filter.or (
Filter.like ("displayName", query),
Filter.like ("name", query)
),
Filter.like ("catloginid", query)
));
ops.setScopeResults(false);
return ops;
]]>
</Source>
</Script>
</FilterScript>
<OrderBy>
<String>firstname</String>
<String>lastname</String>
<String>name</String>
<String>id</String>
</OrderBy>
</IdentityFilter>
</value>
</entry>
<!-- entry end -->
</Map>
</value>
</entry>
</Map>
</Attributes>
</Configuration>
Hope this helps!
In the first approach is it possible to do ignore scoping??
It’s been a while since I worked on forms, I’m not sure. Give it try both. I remember the second one worked for me last time!