ajout de la méthode de queryset viewable_by(user), qui filtre un QuerySet de Picture pour ne garder que les images visibles par l'utilisateur passé en paramètre
Passage aux règles suivantes pour la visibilité des images :
les root et les admins SAS peuvent tout voir
les cotisants et anciens cotisants peuvent voir toutes les photos modérées
les non-cotisants peuvent voir les photos sur lesquelles ils ont été identifiés
Modification de la manière dont le cache est géré dans Picture.can_be_viewed_by(user). Au lieu de chercher dans le cache si l'utilisateur est cotisant, avant de rajouter éventuellement d'autres vérifications, on regarde si la photo fait partie des photos visibles par l'utilisateur stockées dans le cache.
Application de ces droits à la route GET /api/sas/picture
Pagination de la route GET /api/sas/picture
Passage à un rendu dynamique pour les photos d'un album.
Dans cette PR :
viewable_by(user)
, qui filtre un QuerySet dePicture
pour ne garder que les images visibles par l'utilisateur passé en paramètrePicture.can_be_viewed_by(user)
. Au lieu de chercher dans le cache si l'utilisateur est cotisant, avant de rajouter éventuellement d'autres vérifications, on regarde si la photo fait partie des photos visibles par l'utilisateur stockées dans le cache.GET /api/sas/picture
GET /api/sas/picture