Jump to content
We've recently updated our Privacy Statement, available here ×
  • Restrict access to 'Save/Save As' button based on role in TIBCO JasperReports® Server


    stasp
    • Features: JasperReports Server Version: v6.3.0 Product: JasperReports® Server

    Request

    There is a need to restrict access to 'Save/Save As' button based on user role in TIBCO JasperReports® Server.


    Implementation

    This would require some customization of JSP files. In short, you'll have to open this file:

    WEB-INFjspmodulesviewReport 

    and add to the top: 

    <%@ taglib prefix="authz" uri="http://www.springframework.org/security/tags" %>
    

    Then, search in that file for this line: 

    <li class="leaf">
        <button id="fileOptions"
                class="button capsule mutton up first"
                title="<spring:message code="button.save"/>"
                disabled="true">
            <span class="wrap">
                <span class="icon">
                </span>
                <span class="indicator">
                </span>
            </span>
        </button>
    </li>
    

    and wrap this tag around it: 

    <authz:authorize ifAllGranted="ROLE_MYROLE"> ... </authz:authorize>
    

    Note that in the above example, ROLE_MYROLE is at the root level, not under an organization. If you want to use a role that is under an organization for your condition, you need to add this the organization name as part of the role, e.g.:

    <authz:authorize ifAllGranted="ROLE_MYROLE|organization_1"> ... </authz:authorize>
    

    Other Notes

    This is only one specific use case of customizing access to menu items based on role.

    For basic guedelines, and more general information, you may want to check the 'Restricting Access by Role' section of Jasperserver Ultimate Guide.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...