DASSL / ClassDB

An open-source system to let students experiment with relational data
https://dassl.github.io/ClassDB/
Other
7 stars 2 forks source link

Add new user views #188

Closed wildtayne closed 6 years ago

wildtayne commented 6 years ago

This PR adds the new user views discussed for #184. A summary of the changes:

Similar functions and views limited to only connection or DDL activity have not been added, but could be easily added in the future, since all functions now take a NULL parameter.

smurthys commented 6 years ago

That is a lot of views and functions @srrollo. Kudos on the orchestration. 👍

I love the trick in getUserActivity (and elsewhere) to choose between one user and all users. 🥇

(I wonder if that trick has a security risk. Not saying I know there is, but that question just popped into my head.)

A few things (some minor):

afig commented 6 years ago

Looks pretty good apart from the improvements that @smurthys suggested.

wildtayne commented 6 years ago

Thanks for the review @smurthys. I've push a commit addressing most of the observations. A couple notes:

I don't think the use of COALESCE in these functions presents an issue, simply because unprivileged users can never provide an input to those functions other than the result of SESSION_USER (unless their Postgres rolename was NULL, somehow).

smurthys commented 6 years ago

Thanks @srrollo for the changes. Eyeballing them, they look good.

We should discuss the LIKE trick on campus. I've no particular security concern as of now.