Helical Insight has a robust APIs that can be used to share the datasource connection with the user.
You can find the list of APIs in the API document available at:
Page no. 304 onwards, you will find the list of APIs for sharing.
Alternatively, you can also use Java code in order to implement sharing as shown below:
//for datasource share
String formData = "{\"type\":\"dataSource\",\"id\":\"890\",\"classifier\":\"global\",\"dataSourceProvider\":\"tomcat\",\"share\":{\"user\":[{\"id\":\"9\",\"permission\":\"0\"}]}}";
ServiceUtils.execute(“core”, “share”, “update”, formData);
//for folder share and revoke.
formData="{\"type\":\"folder\",\"dir\":\"1593781287204\",\"revoke\":{\"user\":[{\"id\":\"2\",\"permission\":\"2\"},{\"id\":\"5\",\"permission\":\"2\"}]},\"share\":{\"user\":[{\"id\":\"6\",\"permission\":\"2\"}]}}"
Here, it is important to note the id or the user and the corresponding permission level.
The user id is the unique identifier of the user in the system.
There are 6 permission levels (from 0 to 5) in Helical Insight. These are:
- No access
- Execute Only
- Read Only
- Read + Write
- Read + Write + Delete
- Read + Write + Delete + Share
It is always recommended that datasources be shared with Execute only or Read only permissions.