I want to prevent normal users from scheduling a report.
Only administrator will have the right to schedule report.
Is it possible with JasperReports Server
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes, it is possible.
You should edit the jasperserver\WEB-INF\actionModel-search.xml
file.
You need to find the definition of ScheduleAction
action in this file and add the condition for the ROLE_ADMINISTRATOR role:
<context name="resource_menu">
<simpleAction labelKey="RM_BUTTON_RUN" action="invokeRedirectAction" actionArgs="RunResourceAction"
clientTest="canBeRun" className="up"/>
<condition test="isSupportedDevice">
<simpleAction labelKey="RM_BUTTON_RUN_IN_BACKGROUND" action="invokeRedirectAction" actionArgs="RunInBackgroundResourceAction"
clientTest="canBeRunInBackground" className="up"/>
<condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR">
<simpleAction labelKey="RM_BUTTON_SCHEDULE_REPORT" action="invokeRedirectAction" actionArgs="ScheduleAction"
clientTest="canBeScheduled" className="up"/>
</condition>
<simpleAction labelKey="RM_BUTTON_WIZARD" action="invokeRedirectAction" actionArgs="EditResourceAction"
clientTest="canResourceBeEdited" className="up"/>
</condition>
I've just add the <condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR">
for the ScheduleAction
action.
After that you should restart the application server (Tomcat).