Jump to content
We've recently updated our Privacy Statement, available here ×
  • Disabling Dashboard Creation for General Users


    phchrist

    [toc on_off::hide=1]

    Some customers want to limit the ability to create dashboards in JasperReports Server to users with an assigned role of ROLE_ADMINISTRATOR. Here is a description of how to accomplish that:

    The file actionModel-navigation.xml which in Windows normally can be found in a directory such as

    C:Program Filesjasperreports-server-4.0apache-tomcatwebappsjasperserver-proWEB-INF

    contains this XML near the end of the file:

    <!-- jasperserver designer pro only -->
    <context name="main_create_mutton" test="isProVersion">
    <selectAction labelKey="NAV_005_CREATE">
            <option labelKey="NAV_051_ADHOC_REPORT" action="primaryNavModule.navigationOption" actionArgs="designer"/>
            <option labelKey="NAV_050_DASHBOARD" action="primaryNavModule.navigationOption" actionArgs="dashboard"/>
            <condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR">
                <option labelKey="NAV_056_DOMAIN" action="primaryNavModule.navigationOption" actionArgs="domain"/>
            </condition>
        </selectAction>
    </context>

    Edit that XML to the following by adding the two lines with the comment <!-- New --> below:

    <!--jasperserver designer pro only-->
    <context name="main_create_mutton" test="isProVersion">
        <selectAction labelKey="NAV_005_CREATE">
            <option labelKey="NAV_051_ADHOC_REPORT" action="primaryNavModule.navigationOption" actionArgs="designer"/>
            <condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR">
    <!-- New -->
                <option labelKey="NAV_050_DASHBOARD" action="primaryNavModule.navigationOption" actionArgs="dashboard"/>
            </condition>
    <!-- New -->
            <condition test="checkAuthenticationRoles" testArgs="ROLE_ADMINISTRATOR">
                 <option labelKey="NAV_056_DOMAIN" action="primaryNavModule.navigationOption" actionArgs="domain"/>
            </condition>
        </selectAction>
    </context>

    We are effectively inserting a condition such that the "dashboard action" is only available to administrators. After the actionModel-navigation.xml file has been edited and saved it is necessary to restart JasperReports Server.

    The JasperReports Server web interface will now provide the Dashboard option in the Create drop-down menu only if the logged-in user has been assigned the role ROLE_ADMINISTRATOR.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...