...
Package the data service file (.dbs file) and the security policy file into a Composite Application (CApp). See the instructions in Packaging Artifacts into Composite Applications.
Warning Once you create the CApp project, note that the information about each of the projects and artifacts that you packaged into the CApp will be listed (under Dependencies in the Composite Application Project POM Editor).
Be sure to set the server role to Enterprise Service Bus for the security policy file as shown below
- Add your WSO2 EI product instance to the Tooling environment and deploy the CApp in the server. See the instructions in Deploying Composite Applications in the Server.
Start the ESB profile. The data service and the security policy is now deployed in WSO2 EI.
Filtering content by user role (Optional)
When you work with data services, you can control access to sensitive data for specific user roles. This facility is called Role-based content filtering. It filters data where specific data sections are only accessible to a given type of users. Follow the instructions given below to add role-based filtering for output elements in your data service.
- Open the data service file in WSO2 EI tooling.
- Add an output element to your data service:
- Right-click the data service and click Add Query to add a new query.
- Right-click the query and click Add Output Mapping to add an output mapping.
- Right-click the output mapping and go to Add Output Mapping → Add Element to add an element.
- Right-click the data service and click Add Query to add a new query.
- Add the user roles as a comma-separated list in the Allowed User Roles field for the output element as shown below.
Creating a custom validator
...