Skip to content

Commit

Permalink
Merge pull request #872 from nextcloud/fix/noid/friend-tg
Browse files Browse the repository at this point in the history
bypass moderator check on CFG_FRIEND
  • Loading branch information
ArtificialOwl authored Dec 21, 2021
2 parents 5ac5fe9 + 6b31425 commit f608e18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/FederatedItems/MassiveMemberAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use OCA\Circles\IFederatedItemAsyncProcess;
use OCA\Circles\IFederatedItemHighSeverity;
use OCA\Circles\IFederatedItemMemberEmpty;
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCA\Circles\Model\Helpers\MemberHelper;
use OCA\Circles\Model\Member;
Expand All @@ -64,8 +65,10 @@ public function verify(FederatedEvent $event): void {
$initiator = $circle->getInitiator();

$initiatorHelper = new MemberHelper($initiator);
$initiatorHelper->mustBeModerator();

if (!$circle->isConfig(Circle::CFG_FRIEND)) {
$initiatorHelper->mustBeModerator();
}

$members = $event->getMembers();
$filtered = [];

Expand Down
4 changes: 3 additions & 1 deletion lib/FederatedItems/SingleMemberAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ public function verify(FederatedEvent $event): void {
$initiator = $circle->getInitiator();

$initiatorHelper = new MemberHelper($initiator);
$initiatorHelper->mustBeModerator();
if (!$circle->isConfig(Circle::CFG_FRIEND)) {
$initiatorHelper->mustBeModerator();
}

$member = $this->generateMember($event, $circle, $member);

Expand Down

0 comments on commit f608e18

Please sign in to comment.