Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI is always showing GET/POST/DELETE/PATCH on tables/views despite permissions #1870

Open
FrankvdAa opened this issue Jun 8, 2021 · 3 comments
Labels
enhancement a feature, ready for implementation OpenAPI

Comments

@FrankvdAa
Copy link

If a certain user isn't granted access to a certain table or view, it's not shown in the OpenAPI output, which seems correct.

But, views only allow for SELECT queries so why showing also POST/DELETE/PATCH options? Also, if I only allow certain access to a table, I would only expect the corresponding features in OpenAPI output.

Is there a reason that the OpenAPI is always showing GET/POST/DELETE/PATCH features for all tables and views?

@wolfgangwalther
Copy link
Member

But, views only allow for SELECT queries

This is not correct. See https://www.postgresql.org/docs/current/rules-views.html#RULES-VIEWS-UPDATE. Views can be made to support INSERT, UPDATE and DELETE.

Is there a reason that the OpenAPI is always showing GET/POST/DELETE/PATCH features for all tables and views?

The only reason is that a more fine-grained output is not implemented, yet. We are unlikely to make major changes to the OpenAPI output right now, because we expect to move it out of core alltogether (see #1698). Once we have solved that, we're in a much better position to improve OpenAPI a lot.

@wolfgangwalther wolfgangwalther added enhancement a feature, ready for implementation OpenAPI labels Jun 8, 2021
@FrankvdAa
Copy link
Author

This is not correct. See https://www.postgresql.org/docs/current/rules-views.html#RULES-VIEWS-UPDATE. Views can be made to support INSERT, UPDATE and DELETE.

Good to know, wasn't aware of that. I'll then just have to wait for #1698 to be completed.

Thanks!

@laurenceisla
Copy link
Member

Btw, here are the steps to reproduce this: #2443 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a feature, ready for implementation OpenAPI
Development

No branches or pull requests

3 participants