Multiple roles assign to user in djnago

77 views
Skip to first unread message

Ketul Suthar

unread,
Dec 19, 2017, 7:40:40 AM12/19/17
to Django users
I have admin who can create User and Manager

User (id, name, password,role)
Manager (id, name, password,role)


So how can i achieve using admin panel in djnago ?

for that I have to extend User model or create other model ?


Can I use same model for User and Manager ? If the i have to add role field hoe can I add to User model ?

And all this thing I have to handle from Django admin side how can I achieve it ?

Constantine Covtushenko

unread,
Dec 19, 2017, 9:43:17 AM12/19/17
to django...@googlegroups.com
Hi Ketul,

Did you read that django documentation?
There you can find all about users, their roles/groups and permissions.

Also can you please elaborate what do you mean under `admin panel`?
Is it just a reference to admin site?

Does it make sense?

Regards,
Constantine C.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/870fe422-9be6-4e88-bd47-2572296c224e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Sincerely yours,
Constantine C

Ketul Suthar

unread,
Dec 19, 2017, 9:47:47 AM12/19/17
to django...@googlegroups.com
Yes. But I want to  assign role to user as normal user and manager based on selection from drop down in admin site and also add new field role_id in auth_user table

Constantine Covtushenko

unread,
Dec 19, 2017, 10:54:56 AM12/19/17
to django...@googlegroups.com
Sorry but it is still not clear why you can not use Group for that?
For instance you can create group `Manager` and assign any additional permissions to it based on your app requirements.

Regarding to User you have 2 options here as said on this page
> You can extend the default User model, or substitute a completely customized model.

this is a preferable way to do it.

I hope it make sense to you.

Regards,
Constantine C.


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages