1👍
One way would be to create another user model for contacts inheriting from AbstractBaseUser
. And then creating custom auth backend that would look in both models to login user. Finaly you would have to distinguish between standard user and contact user before every action.
That is if contact user and standard user differ significantly in your application.
Or you could just create custom user in your application, that would contain is_contact
attribute. This would be used for both types of users. You would set that as AUTH_USER_MODEL
in settings and check before every action for the is_contact
attribute to determine the outcome. You could return 403 for the contact user if he tries to access what he’s not suppose to.
Or if you use permissions in your application, you could set the contact user’s persmissions only to view statuses of the users that added him as a contact and nothing else.