mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-06 18:15:17 +00:00
Extended profiles picture access to board members
This commit is contained in:
parent
a67787e56d
commit
6279135709
@ -919,7 +919,7 @@ class SithFile(models.Model):
|
|||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _("file")
|
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.
|
Tell if the user can manage the file (edit, delete, etc.) or not.
|
||||||
Apply the following rules:
|
Apply the following rules:
|
||||||
@ -943,7 +943,9 @@ class SithFile(models.Model):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
# If the file is in the profiles directory, only the roots can manage it
|
# 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 True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user