In my application I have the user model that extends AbstractUser and I have added two boolean fields, my question is, how can I make the user not enter certain views by url depending on whether it is validator or is a digitizer? So far I have only done such validations at the template level but if I type in the address bar the template is rendered, it would be nice if I can make it return to the previous view.
User model:
class User(AbstractUser):
creado_por = models.ForeignKey('self', null=True)
es_digitador = models.BooleanField(default=False, help_text=_('Indica si el usuario tiene permisos de crear y modificar.'),)
es_validador = models.BooleanField(default=False, help_text=_('Indica si el usuario tiene permisos de validar la informacion.'),)