Ensure follower is approved to access library

This commit is contained in:
Eliot Berriot 2018-04-17 23:08:15 +02:00
parent 899ba31162
commit c17f7eefde
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 18 additions and 2 deletions

View file

@ -16,4 +16,5 @@ class LibraryFollower(BasePermission):
return False
library = actors.SYSTEM_ACTORS['library'].get_actor_instance()
return library.followers.filter(url=actor.url).exists()
return library.received_follows.filter(
approved=True, actor=actor).exists()