Currently, JDBC datasource Allowed Roles / role mapping cannot be set through API. The DataSourceConfigService exposes operations like create/get/delete for JDBC datasources, but there is no API available for managing the Security role mapping shown in the UI.
For another service integrating with OAS Publisher , if users are given access to publisher dynamically , would need a way to restrict the datasource access for those users through API .