[Download] | [Documentation Home] | [Release Note]
Introduction
WSO2 Data Services Server provides the feature to control the access the sensitive data for specific users roles. Means it will filter the data, where specific data sections are only accessible by the given type of users.
Step 1 - Create New Roles and Assign them to Users
Users and new roles needs to be created and new roles should be assigned to the users.
Step 2 - Edit data service
In order to filter the data service click on the data service and click on edit. Under Query section in the edit wizard click edit query on the query which needed to filtered.
Figure 1: Edit querry
Step 3 - Edit Query with the Required Roles Set
Edit the field which needed to be filtered under output mapping and tick the appropriate user role in the "Allowed user role selection".
Figure 2: Edit output mapping
After all the required roles have been set for the result entries the Edit Query page should resemble Figure 3.
Figure 3: Output mapping
Step 4 - Enable User Authentication for the Data Service
In order for the service to identify the user who is sending requests, security must be enabled for it and a method for authentication must be provided. Therefore, click on the security under service and enable the security. And also select the type of authentication under the 'Basic Scenarios' section.
Figure 4: Enable security
Activate Security will display the user groups that have the access the service, select the needed user group to allow access to the service.Activate Security will display the user groups that have the access the service, select the needed user group to allow access to the service.
Figure 5: Enable security
Step 5 - Try your service
Click on "Try It" link to invoke the servie. According to the user login the result of try it will vary.
Figure 6: Try-it without filtering
Figure 7: Try-it with filtering