Skip to content

Only Read Operattions #2388

Answered by seantleonard
amitjaura asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Amit,

Yes, You would need to restrict your entity's in dab-config.json to only allow the "read" operation. The OpenAPI doc exposed and used by swagger always shows all endpoints, but executing commands against those endpoints only works if the correct permissions (or any permissions at all) are defined for the given operation.

This doc article has a good example: https://learn.microsoft.com/en-us/azure/data-api-builder/authorization#permissions-must-be-explicitly-configured

"EntityName": {
  "source": "dbo.books",
  "permissions": [{
    "role": "anonymous",
    "actions": [ "read" ]
  }]
}

will only allow the read operation (GET) to be executed. All other operations will result in 403…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by amitjaura
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants