Skip to content

Conversation

@cmerrick
Copy link

@cmerrick cmerrick commented Jul 30, 2019

This change isn't compatible with Postgres<8.4, but we don't support versions prior to 9.3 anyway.

Tests confirm this change is backwards-compatible, as does this blurb from the postgres docs:

has_column_privilege checks whether a user can access a column in a particular way. Its argument possibilities are analogous to has_table_privilege, with the addition that the column can be specified either by name or attribute number. The desired access privilege type must evaluate to some combination of SELECT, INSERT, UPDATE, or REFERENCES. Note that having any of these privileges at the table level implicitly grants it for each column of the table.

@cmerrick cmerrick requested a review from psantacl July 30, 2019 17:59
@cmerrick cmerrick changed the title make discovery work when user has SELECT to only some columns on a table make discovery work when user has SELECT on only some columns on a table Jul 30, 2019
@cmerrick cmerrick requested a review from dmosorast July 30, 2019 18:49
Copy link
Contributor

@dmosorast dmosorast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The "implicit" in the docs you linked had concerned me, but it looks like this query finds the columns if SELECT is only granted on the table, so I'm good to merge.

@dmosorast dmosorast merged commit 6a4fec6 into master Jul 30, 2019
@dmosorast dmosorast deleted the allow-column-level-privileges branch July 30, 2019 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants