Skip to content

Commit

Permalink
Removes edit recipient link (#170)
Browse files Browse the repository at this point in the history
This removes the edit recipient control on discussions that arent private.

Co-authored-by: Daniël Klabbers <[email protected]>
  • Loading branch information
imorland and luceos authored Mar 7, 2022
1 parent 1d67c1a commit fbb9797
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Api/DiscussionPermissionAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit fbb9797

Please sign in to comment.