From a7136df5d23522a1f7092c0792b183708609ec9b Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Thu, 9 Feb 2023 11:06:03 +0100
Subject: [PATCH] let followers analyse corpus
---
app/corpora/cqi_over_socketio/__init__.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/corpora/cqi_over_socketio/__init__.py b/app/corpora/cqi_over_socketio/__init__.py
index c122e12e..cd02bedd 100644
--- a/app/corpora/cqi_over_socketio/__init__.py
+++ b/app/corpora/cqi_over_socketio/__init__.py
@@ -62,7 +62,9 @@ def connect(auth):
if corpus is None:
# return {'code': 404, 'msg': 'Not Found'}
raise ConnectionRefusedError('Not Found')
- if not (corpus.user == current_user or current_user.is_administrator()):
+ if not (corpus.user == current_user
+ or current_user.is_following_corpus(corpus)
+ or current_user.is_administrator()):
# return {'code': 403, 'msg': 'Forbidden'}
raise ConnectionRefusedError('Forbidden')
if corpus.status not in [