-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add database_privileges.replace_for_roles
RPC function.
#3781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I've added a minor suggestion.
msar.build_database_privilege_replace_expr(role_oid, direct), | ||
E';\n' | ||
) || ';' | ||
FROM jsonb_to_recordset(priv_spec) AS x(role_oid regrole, direct jsonb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msar.build_database_privilege_replace_expr(role_oid, direct), | |
E';\n' | |
) || ';' | |
FROM jsonb_to_recordset(priv_spec) AS x(role_oid regrole, direct jsonb); | |
msar.build_database_privilege_replace_expr(role_oid, privileges_), | |
E';\n' | |
) || ';' | |
FROM jsonb_to_recordset(priv_spec) AS x(role_oid regrole, privileges_ jsonb); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will work, will it? I'd need to check, but I'm pretty sure jsonb_to_recordset
needs accurate key names in the AS
clause. So, we need to leave it as direct
to match with what we expect in the spec when called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked. It won't work that way without either making some adapter in Python to convert the JSON between formats (do not want) or changing the API spec (also do not want).
Fixes #3773
Adds the
database_privileges.replace_for_roles
RPC function.Technical details
The function is documented, and its use should be self-explanatory.
Screenshots
Checklist
Update index.md
).develop
branch of the repositoryvisible errors.
Developer Certificate of Origin
Developer Certificate of Origin