From fbb9797e7fbb786d799005361867a1082b731fba Mon Sep 17 00:00:00 2001 From: Ian Morland <16573496+imorland@users.noreply.github.com> Date: Mon, 7 Mar 2022 22:34:19 +0000 Subject: [PATCH] Removes edit recipient link (#170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the edit recipient control on discussions that arent private. Co-authored-by: Daniƫl Klabbers --- src/Api/DiscussionPermissionAttributes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Api/DiscussionPermissionAttributes.php b/src/Api/DiscussionPermissionAttributes.php index d71e4fd..2985ed7 100644 --- a/src/Api/DiscussionPermissionAttributes.php +++ b/src/Api/DiscussionPermissionAttributes.php @@ -40,7 +40,7 @@ public function __invoke(DiscussionSerializer $serializer, Discussion $model, ar $users = $actor->can('editUserRecipients', $model); $groups = $actor->can('editGroupRecipients', $model); - $attributes['canEditRecipients'] = $users || $groups; + $attributes['canEditRecipients'] = $model->is_private && ($users || $groups); $attributes['canEditUserRecipients'] = $users; $attributes['canEditGroupRecipients'] = $groups;