#### Editing a connection-scope security policy

When a connection-scope security policy has been set up, that is a data source security entry has been added to a connection, you can further edit it according to your requirements.

To editing a connection-scope security policy, in the Data tab of the Catalog Browser, select the data source that contains the security policy, right-click the security entry in the Data Source Security node and select Edit Security from the shortcut menu. In the Security dialog, edit the security policy as required. See the dialog.

- To add more users/roles/groups, in the Security dialog, select the corresponding tab and click Add.
- To delete a user/role/group, in the Security dialog, click the corresponding tab, select the user/role/group, and then click Delete.
- To edit a user/role/group, in the Security dialog, click the corresponding tab, select the user/role/group, and then click Property.

In addition, with the Security dialog, you can import security information from JReport Enterprise Server, or import/export security information from/to external XML files as you like.

##### Importing security information from JReport Enterprise Server

Besides defining users, roles and groups in JReport Designer, you can also use the users, roles and groups defined in JReport Enterprise Server by importing user/role/group information from the server. Before importing, make sure that JReport Enterprise Server has been started. Then:

1. In the Security dialog, click Security > Import from JReport Enterprise Server.

2. In the Import from JReport Enterprise Server dialog, specify the server information as required. See the dialog.

3. Specify whether to replace or merge users, roles and groups with JReport Enterprise Server by checking the corresponding radio button.
4. Click OK to start importing.

Notes:

- You must be a user in the administrators group in order to log in to perform the importing.
- The users/roles/groups from JReport Enterprise Server will be marked as Server in the Source field in the Security dialog, while others defined in JReport Designer will be marked as UserDefined. See illustration.

- A user from JReport Enterprise Server cannot be reassigned to (or removed from) a role from the server. Similarly, a role from the server cannot be re-assigned to (or removed from) a user from the server. So, if both users and roles are obtained from the server, you will not be able to change their parental relationships.

  You cannot assign a role from the server to a local user (UserDefined), while a user from the server can be assigned to a local role.

- During importing, if any users/roles, whose source names are Server, have the same names as those on the server, their properties will be refreshed with new information from the server, for example, role, or group information and parental relationships. However, their permission settings will be reserved. Specially, if a user from the server has been assigned to any roles defined in Designer, then these roles will be reserved in its members list.

##### Importing/exporting security information from/to external XML files

You can import or export your security information from/to external XML files (*.acl.xml). To do this, on the Security menu of the Security dialog, click Import from File or Export to File.

The security information contained in the XML file is shown as below:

You can create your own XML format security information files according to the above structure. However, the best way to generate an XML security information file is to use the Security dialog. With this dialog, you can edit the security information, and then export it to an external XML file.

For example, if the simple security policy has been set up as below:

USER
User Name: | d_d_u1
Belongs to Role: | d_d_r1
Permissions: | (@"Customer ID">=5 AND @"Customer ID"<=10) AND @"YTD Sales"<=65000
ROLE
Role Name: | d_d_r1
Belongs to User: | d_d_u1

The corresponding XML code would be:

`<ACL version="1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ACLEntry> <User> <Roles>d_d_r1</Roles> <UserName>d_d_u1</UserName> <SourceName>UserDefined</SourceName> </User> <Permission> <PermissionType>RLS</PermissionType> <PermissionName>visible</PermissionName> <Policy> <SCGroup> <AndCondition> <logic>AND</logic> <Left>@&quot;Customer ID&quot;</Left> <operator>&gt;=</operator> <Right>5</Right> </AndCondition> <AndCondition> <logic>AND</logic> <Left>@&quot;Customer ID&quot;</Left> <operator>&lt;=</operator> <Right>10</Right> </AndCondition> </SCGroup> <SCGroup> <AndCondition> <logic>End</logic> <Left>@&quot;YTD Sales&quot;</Left> <operator>&lt;=</operator> <Right>65000</Right> </AndCondition> </SCGroup> </Policy> </Permission> </ACLEntry> <ACLEntry> <Role> <RoleName>d_d_r1</RoleName> <Users>d_d_u1</Users> <SourceName>UserDefined</SourceName> </Role> <Permission> <PermissionType>RLS</PermissionType> <PermissionName>visible</PermissionName> <Policy></Policy> </Permission> </ACLEntry> </ACL>`

Note: If you want to use XML security information, you must first purchase a special license. For more information, contact Jinfonet Support (support@jinfonet.com).