User Based role in Django

閲覧: 29 回
最初の未読メッセージにスキップ

Mannu Gupta

未読、
2017/06/21 3:45:132017/06/21
To: Django users
I want to make a role based user in Django like the following :- 

User with Subscription level 0 will have some feature and some basic fields like first name , last name etc. 
User with Subscription level 1 will have some more feature and some extra fields  like tax-id , national id , nationality, is_disable etc . 
User with Subscription level 2 will have more features with all the fields with the fields with same as fields of Subscription level 1 since he has already subscribed only he is upgrading.
User with Subscription level 3 will have more feature with all the fields with the fields same above .

How do i make the user model and related this relate to its role , and how do i be able to set permission for different user ?

Jani Tiainen

未読、
2017/06/21 4:12:082017/06/21
To: django...@googlegroups.com
Hi,

We have been using user groups for that. And then we check and filter out based on given group(s).

--
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/4bdc5c54-5c90-4515-b977-30fcb612b3ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mannu Gupta

未読、
2017/06/21 4:15:022017/06/21
To: django...@googlegroups.com
Hi , 
Will I be able to trace if user upgrde the subscription level ?

Manni

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/2JjuGF1-4PU/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Jani Tiainen

未読、
2017/06/21 4:18:482017/06/21
To: django...@googlegroups.com
Well its your code, so yes if you write code that does it.

It doesn't happen magically for you.

Mannu Gupta

未読、
2017/06/21 4:24:072017/06/21
To: django...@googlegroups.com
I meant that using your method i.e by making different groups .
When he upgrade the group .
How about making another table having user, his subscription level and changed_at field(which traces when he /upgrade the group )

Just want to know your suggestion .

Mannu

Jani Tiainen

未読、
2017/06/21 5:44:262017/06/21
To: django...@googlegroups.com
Hi,

User can't upgrade his group. It is your code that does it. And it is your code responsibility to track changes etc.

User just may have a button on ui that invokes your code (view) but rest is really up to you.

全員に返信
投稿者に返信
転送
新着メール 0 件