Contents
Can you have user, customer and Admin in the same table?
In my web application I will have three types of accounts. Should all these three be in separate tables or in one with a column named “account_type” where i can mark it as User, Customer or Admin? What are the pros and cons for both? Is there a best practice for this?
Is there such thing as too many admins?
They have thousands of applications, many of which have hundreds of administrators; in fact, for some of those applications, every user was an administrator. In most of those cases, I’m referring to normal user accounts (not an OS or network admin account) that had the highest-level application privileges.
Why is it bad to have an admin account?
But this has some security risks associated with it. If malware is installed under your user account, the malware can do anything that you can do. So the more permissions your user account has, the greater damage the user account can do. Standard accounts don’t have as much flexibility.
Why are standard accounts more secure than admin accounts?
Non-admin accounts can be locked down in a variety of ways. With user controls, administrators can place much more severe restrictions on user accounts. This runs the gamut from prohibiting certain applications and URLs to setting a daily time limit. Why are standard accounts more secure than admin accounts?
How to add custom user model in admin panel?
Do not include `groups`since you do not have it search_fields = () # Contain only fields in your `custom-user-model` intended for searching ordering = () # Contain only fields in your `custom-user-model` intended to ordering filter_horizontal = () # Leave it empty.
How to create custom admin model in Django?
However, if your user model extends AbstractBaseUser, you’ll need to define a custom ModelAdmin class. It may be possible to subclass the default django.contrib.auth.admin.UserAdmin; however, you’ll need to override any of the definitions that refer to fields on django.contrib.auth.models.AbstractUser that aren’t on your custom user class.
Can a user have more than one table?
If a user can be of more than one account type, you should then have a different table with a foreign key, Firstname – varchar (50) etc… Pros and Cons vary based on the size and complexity of your system.