def get_permissions(self): permissions = super().get_permissions() user = self.request.user permissions['list_collection_users'] = user_permissions.list( user, collection=self.object.collection) permissions['list_collection_licences'] = licence_permissions.list( user, collection=self.object.collection) return permissions
def has_view_permission(self): user = self.request.user return licence_permissions.list(user, collection=self.object)