Report-scope security

The record-level security (RLS) can be of report scope, which is based on the security information file. That is, you can use the security information file to set the security policies for a report. Report-scope security policy doesn't support column-level security (CLS).

Report-scope security has a higher priority than connection-scope security. That is, if in a report, both connection-scope and report-scope security have been applied, only the report-scope security will take effect.

Setting up a RLS policy for a report

The following example shows you how to set up a record-level security policy for a report:

  1. Click File > Open in JReport Designer.
  2. In the Open Report dialog, click the Browse button to open the catalog file SampleReports.cat in <install_root>\Demo\Reports\SampleReports, then open the sample report EmployeeInformation.cls.
  3. In the Report Inspector, select EmployeeInformation in the Datasets node.
  4. In the Security section of the Properties panel, click to the right of the Record Security property entry to open the Record Level Security Information dialog. See the dialog.
  5. Click the Add button to add a condition line and edit the security information as required by clicking corresponding cells.

    Since the record-level security policies are file-based, you can just create a new text file, add the security settings, and then link the file to your report. Below are steps detailing how to import the security information from a text file.

    1. In the Record Level Security Information dialog, click the Import Text button.
    2. In the Select Record Level Security File dialog, specify the text file that contains the predefined security information and click Open.
    3. Information set in the text file will be displayed in the Record Level Security Information dialog. Click the cells to edit them if required.
    4. Click OK to make the security policy applied.
  6. Click OK to close the dialog.
  7. Click the View tab to view the report. You will then be prompted to provide security ID (SID), which refers to the user name. Type the SID, and then click OK. Only the records which satisfy the condition will be displayed.

After you have set up RLS for reports in JReport Designer, you can then publish them to JReport Server as normal. Then, when you log onto JReport Server as different users, you will find that the record-level security settings have been applied to the report. Different users will only see the data that they are supposed to see.

Notes: