By default when I create a model Django gives permissions like
add/change/delete/view
If I give any of the above permission to a specific user then that user can view all the objects from that model. But I want to show them only objects linked with foreign keys.
Let's Say,
I have a Book model
class Book(models.Model):
title = models.CharField(max_length=100)
author = models.ForeignKey(
User, on_delete=models.CASCADE
)
If I want to give authors permission, they can only view their linked books from the Django admin.
How can I do that?