From 62791357092a4e795c05a7f5694cda02592c0619 Mon Sep 17 00:00:00 2001 From: Julien Constant Date: Thu, 13 Apr 2023 18:50:04 +0200 Subject: [PATCH] Extended profiles picture access to board members --- core/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/models.py b/core/models.py index d231371e..5449a273 100644 --- a/core/models.py +++ b/core/models.py @@ -919,7 +919,7 @@ class SithFile(models.Model): class Meta: verbose_name = _("file") - def can_be_managed_by(self, user) -> bool: + def can_be_managed_by(self, user: User) -> bool: """ Tell if the user can manage the file (edit, delete, etc.) or not. Apply the following rules: @@ -943,7 +943,9 @@ class SithFile(models.Model): return True # If the file is in the profiles directory, only the roots can manage it - if profiles_dir in self.get_parent_list() and user.is_root: + if profiles_dir in self.get_parent_list() and ( + user.is_root or user.is_board_member + ): return True return False