Hi, I am fairly new to Django and working on a personal project. I am trying to restrict data rendered on a page based on a user group. my model for the data being rendered is similar to the below
class report(models.Model):
report_name = models.CharField()
report_description = models.TextField()
report_link = models.CharField()
report_department = models.ForeignKey()
report_user_group = models.ForeignKey() - This is the column the restricrion needs to be based on
date_created = models.DateTimeField()
for eg: if the ‘report_user_group’ is set to Executive then a user belonging to the Executive group must only be served the reports with with the report_user_group “Executive”
Thank you for assisting.