schemainspect icon indicating copy to clipboard operation
schemainspect copied to clipboard

Add support for view, sequence, column & function privileges

Open biodevc opened this issue 3 years ago • 10 comments

Currently only TABLE privileges (aka roles, permissions) are handled.

This adds support for VIEWS, SEQUENCES, COLUMNS & FUNCTIONS.

biodevc avatar May 14 '21 02:05 biodevc

I just saw that @michaelbeaumont had done the groundwork for function privs so copied and tweaked his query. It should address #djrobstep/migra#64

biodevc avatar May 14 '21 10:05 biodevc

Could you also add schema privileges? They are missing too.

provokateurin avatar Jul 23 '21 11:07 provokateurin

I implemented the schema privileges. @biodevc could you pickup https://github.com/stack11/schemainspect/commit/2107f082613def968615dc0e48413b9555193056 in your PR?

provokateurin avatar Aug 03 '21 07:08 provokateurin

I implemented the schema privileges. @biodevc could you pickup stack11@2107f08 in your PR?

Just added your mods but altered the query since it was producing wierd results for me

biodevc avatar Oct 28 '21 03:10 biodevc

Huh what results? We've been using this patch in production and it always worked for us.

provokateurin avatar Oct 28 '21 09:10 provokateurin

Huh what results? We've been using this patch in production and it always worked for us.

If a role has 'group' members and that role has priveleges granted to a schema, then with your query, all members of the role also get granted priveleges to the schema. So, it "works", but if a member is later removed from the top level role, they'll still have access to the schema.

biodevc avatar Jun 23 '22 00:06 biodevc

@biodevc could you rebase?

provokateurin avatar Jul 28 '22 14:07 provokateurin

A small change that is worth adding to this PR for function privileges to work (needs to include the function signature) https://github.com/joshainglis/schemainspect/commit/14a1d7a6a00dee203033da31461e619b31f2e3b3

joshainglis avatar Jul 29 '22 00:07 joshainglis

@biodevc could you rebase?

I've given up hope of this pull request ever going anywhere. Migra appears to be a dead project at this stage.

biodevc avatar Aug 22 '22 23:08 biodevc

yeah :( but i thought i saw a post somewhere about the maintainer working on these projects again.

provokateurin avatar Aug 23 '22 06:08 provokateurin