[Answer]-Permissions for individual columns of a database table in django?

1👍

I think the best solution highly depends on how “fragmented” the permissions will be. If there are just a few Usergroups who each may have access to a distinct set of columns, you can put these columns into several models.

If permissions can be highly individual and you usually require data from all 70 columns or a varying combination thereof, keep it in one table (also to avoid dozens of joins) and include a permission model like you described.

The django.contrib.auth.permissions should give you already what you need: create 70 Permission-objects, one for each column, and map them either to individual users or to usergroups (depending on the grade of individuality of your permission-vectors)

Leave a comment