Document how to grant access to individual columns
simonw opened this issue · 2 comments
simonw commented
GRANT SELECT(
id, last_login, is_superuser, username, first_name, last_name, email, is_staff, is_active, date_joined
) ON auth_user TO "my-read-only-role";
This is a useful pattern for allowing joins against the users table without exposing password hashes.
simonw commented
simonw commented
Good news though: the technique we use to find the columns available for a table appears to take column permissions into account:
That's this code here:
django-sql-dashboard/django_sql_dashboard/views.py
Lines 139 to 165 in eefa5fb
So rather than generate select *
we should generate explicit column selects, to avoid this issue cropping up in queries generated by clicking on links.