Open clrcrl opened 6 years ago
Definitely! I think this should be quite doable, though if we handle ownership for functions we should also handle permissions for them as well, though that is probably two separate PRs as those ideas don't have to be linked (although the privilege map mentioned below in Ownership point 1 is used on both parts and might force them to be more coupled).
Below is a brief overview on what would likely need to be done. If you have any interest in taking a crack at it let me know! Otherwise this will be on the roadmap but may be prioritized below a few other issues like #3 (Provide multi-database support).
Adding function ownership: There are three places that we would need to modify:
Adding function privileges:
It may sound like a lot, but other than getting the queries right and getting comfortable with how pgbedrock works, it shouldn't be too difficult as I think pgbedrock's machinery is generalized enough that once the queries are correct the rest of the code should just work (though emphasis on "should", of course).
Functions, like tables and schemas, have an owner, which should also be managed by pgbedrock.
For example