Closed rafatower closed 5 years ago
@dgaubert to take an early look. Not final, cause it lacks some changes, a couple utility functions and documentation. Hopefully it'll help us decouple set up from other tasks (e.g: testing through SQL API)
For the record, SECURITY DEFINER
cannot be really removed: https://github.com/CartoDB/cartodb-postgresql/commit/67663c79aa48cab8f3d8dd87b7a2a62a157bf0c3 (at least not in an easy and clean way)
I think this is ready for a review. It lacks documentation but I'd rather write and "beta test" it through the "operations manual" than document here yet. No strong opinion, though.
This adds a couple of functions to ease set up of user foreign servers, mappings and tables.
Sample usage:
NOTE: it is decoupled from carto-lite
It creates a role with the same name of the fdw (in the example, "amazon") and grants it to the caller of the function. So, by default just the caller can access the server, mappings and anything related to it, but they can also grant it to other users (including
publicuser
, the org role or evenpublic
).E.g:
but we want to grant permissions to it:
and from that moment on: