I've been going back and forward between two tutorials on creating custom user models:
and https://wsvincent.com/django-tips-custom-user-model/
So far here is my code:
Model:
class CustomUser(AbstractUser):
is_admin = models.BooleanField('admin status', default=False)
is_areamanager = models.BooleanField('areamanager status', default=False)
is_sitemanager = models.BooleanField('sitemanager status', default=False)
Form:
class CustomUserCreationForm(UserCreationForm):
class Meta(UserCreationForm.Meta):
model = CustomUser
class CustomUserChangeForm(UserChangeForm):
class Meta(UserChangeForm.Meta):
model = CustomUser
Admin:
class CustomUserAdmin(UserAdmin):
add_form = CustomUserCreationForm
form = CustomUserChangeForm
model = CustomUser
list_display = ['email', 'username',]
admin.site.register(CustomUser, CustomUserAdmin)
I have hit a bit of a wall at this point. I'm not sure what direction to go in with restricting content to users. My general idea is I want admins to access everything, area managers to have the next level of access, site manager after that, then regular users (false on all boolean checks) to have base privileges.
Is this the best route to go for this kind of implementation? Where should I go from here and why?