A record-level security (RLS) and column-level security (CLS) policy at data source scope refers to a security entry in the data source of a catalog. It allows you to control user access to different subsets of data, and ensures that people only see what they are supposed to see: certain records and/or columns. If you want to implement the same security policy in a group of reports, you can simply apply the same security entry to the reports, without having to repeatedly build the security information for each report. The predefined security entries work within a data source range, that is they can be applied to resources that are in the same catalog data source.
A security entry with only RLS can also be used to control parameter values at runtime.
To add a security entry to a data source in a catalog, follow the steps below:
You can also click and select Add User, Add Role or Add Group from the drop-down menu to add principals manually in JReport Designer or import them from an XML file.
However if you choose the two methods to add users, roles and groups,
in order for the security policies specified on them to work on JReport Server, you should make sure there are the same users, roles and groups created on JReport Server, and then import them to JReport Designer with the Merge option.
In this way the users, roles and groups are updated to those on the server while the security settings are reserved.
You can further edit or remove the principals in the User/Group/Role panel.
Notes:
To build a condition statement, specify a field in the first text box. You can either type in the name of the field manually or click to specify the field. It can be a DBField, formula, parameter, or special field. Select an operator from the Operator drop-down list. Lastly, specify the value to complete the condition. You can click
to specify the value or input the value manually, and when you type in the value, if multiple values are required, they should be separated with ",", and if "," or "\" is contained in the values, input it as "\," or "\\". You can also use a parameter to apply a dynamic RLS.
If you want to append a new row, in the More drop-down list, select AND or OR.
Values | Description |
---|---|
AND | Specifies the relationship between two expression statements as logical AND. If this line is the last line in the expression list, when you select AND or OR, a new line will be appended to the end of the list. |
OR | Specifies the relationship between two expression statements as logical OR. If this line is the last line in the expression list, when you select AND or OR, a new line will be append to the end of the list. |
Insert Row | Inserts a new line behind the current line. |
Delete Row | Deletes the current line. |
New Group | Adds a new expression group to the list. The relationships between two groups can be:
|
Once a security entry is created, you can further edit it, rename it, or delete it according to your requirement. To do this, right-click the security entry in the Catalog Manager resource tree and select the corresponding option on the shortcut menu.
You can apply a security entry to a page report or library component by setting the Security Policy Name property on its dataset. However, since column-level security is not supported on library components at present, only the security entries which have not been defined with CLS are available in the value list of library components' Security Policy Name property.
After the report or library component is published to JReport Server, when different users log onto the server and run it, they will only see the data they are supposed to see. However, as the user defined users and roles in a security entry may not be recognized by JReport Server, if your security policy contains such users/roles, you need to first create these users and roles respectively on JReport Server, and then in JReport Designer, synchronize the security information with the server by means of importing security information from the sever with the Merge option checked.
However for page reports, the security entries for the primary reports and subreports can be set and applied individually, with different combinations causing different results. The relationships between the security policy settings and the viewing results are shown in the following table:
Primary Report | Subreport | Users in Policy | Users NOT in Policy |
---|---|---|---|
Ð | Ð | No security policy is applied to either the primary report or the subreport. Users can therefore view all records in both reports. | |
Ï | Ð | Can view specified records in the primary report and all records in the subreport. | Can view no records in the primary report and all records in the subreport. |
Ð | Ï | Can view all records in the primary report and specified records in the subreport. | Can view all records in the primary report and no records in the subreport. |
Ï | Ï | Can view specified records in both the primary report and the subreport. | Can view no records in either the primary report or the subreport. |
Ï - Security policy has been set and applied.
Ð - Security policy has not been set and applied