Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example for different types of users #7

Open
aniketmaithani opened this issue Jan 25, 2016 · 7 comments
Open

example for different types of users #7

aniketmaithani opened this issue Jan 25, 2016 · 7 comments

Comments

@aniketmaithani
Copy link
Contributor

Hey @jonathanchu I was thinking to include a more extensible example to support/show different types of users. E.g can be Account Manager, Employee and Blah blah user :P

@jonathanchu
Copy link
Owner

I think that's a great idea! How would you accomplish this? The reason why I made such a simple and barebones example was to make it easy for everyone to see how they could customize this to their liking, without needing to remove code that may be tied to anything else.

@aniketmaithani
Copy link
Contributor Author

@jonathanchu I mean I am thinking of putting up a simple use case for instance, Different Login / Permission for different types of user. Say in a website there is a login for "USER" , "DEVELOPER" and "ADMIN (DJANGO ADMIN BASICALLY)". We can use this by extending the ABSTRACT USER MODEL which is a basic example in the Django documentation.

The reason I am interested in creating such thing is because I use these custom-user-model pretty extensively and frequently and I was hoping if one could just get a plug and play kind of stuff then it becomes easy to implement stuff.

@jonathanchu
Copy link
Owner

Sure, this sounds good to me! Want to take a stab at this? 😺

@aniketmaithani
Copy link
Contributor Author

@jonathanchu yes sure. :)

@aniketmaithani
Copy link
Contributor Author

Aah.. been long didn't take a look at this. Will try to complete this by weekend.

@jonathanchu
Copy link
Owner

@aniketmaithani don't feel bad or rushed for this, any time you devote is appreciated :)

@arpit1997
Copy link

@jonathanchu @aniketmaithani
I have some ideas about this issue. I ran into same kind of problem few weeks ago I tried two different approaches:

  • If we have only two or three level of user then this problem is like a small piece of cake. We can just make django's builtin staff, admin other types and assign them permissions accordingly with our views.
  • Other one is for many level users.This will be little tough. We have to create custom permission decorators to implement this. A decorator is a just a normal function but with some different syntax.
    • in case of assigning permissions we can use the method mentioned above .

Hope this helps. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants