I’m writing a custom v8js script API to make a CouchDB API that can access views. I’m wondering if there is a way with Dreamfactory to allow user roles only access to certain tables? Are components in role definitions supported for custom scripts?
Yes, Role definitions can be added for scripts and remote web services down to the component level, but they require you to add swagger definitions for your service. Otherwise, DreamFactory doesn’t know that the components exist.
Thanks for the response! I’ve written a swagger definition for my service
which populates the API Docs, but I haven’t used it to create components.
What type of data type or schema gets translated from the swagger
definition into a component as seen by DreamFactory?
Since I couldn’t find much information about it in the wiki, I have tried formatting a service definition by mimicking what I have found in the “native” Dreamfactory Services.
Here is an excerpt of the service definition for the service I created. This service accesses the database tables of a MySQL Service. In the example below, the service, when accessed through /api/v2/test-service/content would query the MySQL table and simply pass on the response.
I have tried adding descriptions for responses, and an operationId for each path. Yet it does not help making Dreamfactory see these paths as components, like for “native” services (see for example the user service at the bottom of this post).
Help or links to documentation would be appreciated