Control Scheduling in JasperReports Server

拥有回忆 提交于 2019-12-11 07:45:17

问题


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).



来源:https://stackoverflow.com/questions/9782249/control-scheduling-in-jasperreports-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!