-
Notifications
You must be signed in to change notification settings - Fork 34
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
Feature request: insert/update permissions without delete #39
Comments
Hey Jeff, Thanks for offering a new use case! This is a really useful generalization of what pgbedrock currently provides. I could see us supporting this, though I'm not 100% decided on what that API should look like. I'll propose what I'm thinking below, but I'd be curious to hear your thoughts as well. CLI Changes pgbedrock configure wouldn't necessarily need to change so long as it can identify what kind of spec it's working with: a simplified or non-simplified one. YAML Format
Code Path Two simplifications / assumptions would still be present here though, and I'm curious if you think they make sense:
I guess this comes down to what we want this output to represent: the exact state of things with no assumptions about the future, or a more fine-grained permission mode that still makes things easier for the database administrator in the future. My vote would be for the second, but I'm open to counter-arguments. Again, I'd love to hear your opinion on the above, and if you are interested in collaborating on the above I'd love to sync up and help you how I can!
|
Hi @zcmarine, I've been looking for a while for a system to declaratively manage users, roles, and permissions for my postgres servers. My use case might be slightly different from yours (for example, I don't expect to use the File Format Version SupportFirst, I think it would be useful to have a config file format version: "2"
role-a:
.... This would allow an evolving format, while still supporting older versions. Files not having the Permission "Groups"For my use case, it would be very useful to be able to specify arbitrary permissions (eg version: "1.1"
permissions:
MyPermissionGroup:
- SELECT
- UPDATE
- INSERT
ReadOnly:
- SELECT
roles:
jdoe:
can_login: yes
is_superuser: no
privileges:
tables:
MyPermissionGroup:
- marketing.impressions
- marketing.users
ReadOnly:
- marketing.ad_spend
... Explicit Default PrivilegesOnce again, because I'm not using the roles:
jdoe:
can_login: yes
is_superuser: no
default_privileges:
tables:
MyPermissionGroup:
- myschema
... Explicit "default"
|
Hey @lsowen, sorry for the month-long delay in responding; I was traveling for the last couple months. Those changes make a lot of sense to me and sound valuable, though they'd also entail a large amount of work and are a big enough departure from the existing functionality that it would probably be easier to simply fork the repo and build what you want out of it. To the degree that I can offer any useful context please let me know! |
Hi Zach,
We're building an app where we have some audit/compliance needs that require rows never be deleted -- only updated. It'd be great if pgbedrock had the ability to have more fine-grain permissions other than read/write. I did see the note in documentation about being open to a pull request with that functionality. Before starting in on that, do you have any particular constraints around a pull request that you'd accept?
I also noticed on a quick skim of the read/write code that there's a comment at https://github.com/Squarespace/pgbedrock/blob/master/pgbedrock/privileges.py#L62: "If a write privilege is desired then read access is as well" -- we actually have this case too, where we have a 3rd party system that needs permission to insert incoming data into our system but cannot have read access to that table (just insert, no select). Updating the permissions to be more fine-grain may require revisiting that?
Thanks,
Jeff
The text was updated successfully, but these errors were encountered: