#Need Guidance for users and groups for a project

7 messages · Page 1 of 1 (latest)

tepid shadow
#

Having a bit of a struggle here. Trying to determine what the best django aproach to this is. So Im working on a project. I have technicians and customers. The owner of this is going to have full control and then he has technicians under him. Then customers will have their own dashboard to submit requets. When I was browsing the docs I didnt see a way where I could truly customize the django admin pages(Unless I am mis understanding) I know django admin allows for modifications of data within models etc, But I dont see a way to add lets say custom graphs or other widges minus just basic CRUD actions.(again if Im wrong correct me). So knowing this I am deciding to create a custom dashboard for the owner/technicians and customers. Where im running into issue is how to do access control. I know I could add a custom field to the user model and do it that way or I can just do the integrated django groups mechanism. Just looking for guiandce on how I should approach this.

crystal kayak
#

The integrated groups mechanism can't handle per-object permissions, so if you are storing data from multiple customers in the same table, it won't help you. Having a Customer table, linking users and objects to that, and ensuring you're always filtering where you need to, is a decent approach

tepid shadow
#

Okay but I’m talking more among the lines of access. Like there’s an administrative dashboard that only the owner and technicians can access

crystal kayak
#

Then yeah, you can use the built in groups or is_staff and is_superuser flags

tepid shadow
#

Okay cool. So I would just use user_passes_test with a check for whatever group or super user flags and then use that to control access?

#

Sorry for dumb questions(first time dealing with this in Django)

crystal kayak
#

Yeah, that works!