@@ -123,6 +123,11 @@ public function newShare(int $formId, int $shareType, string $shareWith = '', ar
123123 throw new OCSNotFoundException ('Could not find form ' );
124124 }
125125
126+ if ($ this ->formsService ->isFormArchived ($ form )) {
127+ $ this ->logger ->debug ('This form is archived and can not be modified ' );
128+ throw new OCSForbiddenException ('This form is archived and can not be modified ' );
129+ }
130+
126131 // Check for permission to share form
127132 if ($ form ->getOwnerId () !== $ this ->currentUser ->getUID ()) {
128133 $ this ->logger ->debug ('This form is not owned by the current user ' );
@@ -243,6 +248,11 @@ public function updateShare(int $formId, int $shareId, array $keyValuePairs): Da
243248 throw new OCSNotFoundException ('Could not find share ' );
244249 }
245250
251+ if ($ this ->formsService ->isFormArchived ($ form )) {
252+ $ this ->logger ->debug ('This form is archived and can not be modified ' );
253+ throw new OCSForbiddenException ('This form is archived and can not be modified ' );
254+ }
255+
246256 if ($ formId !== $ formShare ->getFormId ()) {
247257 $ this ->logger ->debug ('This share doesn \'t belong to the given Form ' );
248258 throw new OCSBadRequestException ('Share doesn \'t belong to given Form ' );
@@ -336,6 +346,11 @@ public function deleteShare(int $formId, int $shareId): DataResponse {
336346 throw new OCSNotFoundException ('Could not find share ' );
337347 }
338348
349+ if ($ this ->formsService ->isFormArchived ($ form )) {
350+ $ this ->logger ->debug ('This form is archived and can not be modified ' );
351+ throw new OCSForbiddenException ('This form is archived and can not be modified ' );
352+ }
353+
339354 if ($ formId !== $ share ->getFormId ()) {
340355 $ this ->logger ->debug ('This share doesn \'t belong to the given Form ' );
341356 throw new OCSBadRequestException ('Share doesn \'t belong to given Form ' );
0 commit comments