Question:
How to customize View > Search Results Filters page to remove certain filter options on a per-role basis, for example to remove Schedule filters from everyone except for ROLE_SUPERUSER.
Answer:
NOTE: The solution requires config files modifications so make sure to backup the origin files metioned below
Edit WEB-INFjs.spring.properties by adding the line
bean.scheduleFilter.SuperUserRoleAccessList=SuperUserRoleAccessList
into #For SchedulerFilter and its options section, ~line 220
Edit WEB-INFapplicationContext-search-pro.xml file by adding the lines
<util:list id="SuperUserRoleAccessList"> <bean class="com.jaspersoft.ji.search.common.ProRoleAccess"> <property name="roleName" value="ROLE_SUPERUSER"/> <property name="tenantId"> <null/> </property> </bean> </util:list>
somewhere after <util:list id="proRoleAccessListDefault"> list, ~line 30
Edit applicationContext-search.xml file, locate line
<property name="roleAccessList" ref="${bean.scheduleFilter.RoleAccessList}"/>
~ 316 line no and modify it to
<property name="roleAccessList" ref="${bean.scheduleFilter.SuperUserRoleAccessList}"/>
Save the changes and re-start JasperReports Server.
By these steps you create a new list of roles that should have access to Scheduled Filters and specify the list in Scheduled filters settings.
Ref. Case #00052797
Recommended Comments
There are no comments to display.