from django.contrib.auth.models import AbstractUser, UserManager
from django.db import models

from topdownrbac.models.subject import Subject
from topdownrbac.models.subjecttype import SubjectType


class UserSubject(Subject, AbstractUser):
    name = models.CharField(max_length=100)
    objects = UserManager()

    def _get_subject_type(self):
        return SubjectType.USER

    def _get_user_subjects(self):
        return [self]
