| @@ 155-161 (lines=7) @@ | ||
| 152 | * @throws Exception |
|
| 153 | */ |
|
| 154 | public function addMember($circleUniqueId, $ident, $type, string $instance, bool $force = false) { |
|
| 155 | if ($force === true) { |
|
| 156 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 157 | } else { |
|
| 158 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 159 | $circle->getHigherViewer() |
|
| 160 | ->hasToBeModerator(); |
|
| 161 | } |
|
| 162 | ||
| 163 | if (!$this->addMassiveMembers($circle, $ident, $type)) { |
|
| 164 | $this->addSingleMember($circle, $ident, $type, $instance, $force); |
|
| @@ 567-573 (lines=7) @@ | ||
| 564 | string $circleUniqueId, string $name, int $type, string $instance, bool $force = false |
|
| 565 | ): array { |
|
| 566 | ||
| 567 | if ($force === false) { |
|
| 568 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 569 | $circle->getHigherViewer() |
|
| 570 | ->hasToBeModerator(); |
|
| 571 | } else { |
|
| 572 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 573 | } |
|
| 574 | ||
| 575 | $member = $this->membersRequest->forceGetMember($circleUniqueId, $name, $type, $instance); |
|
| 576 | ||
| @@ 418-423 (lines=6) @@ | ||
| 415 | * @throws Exception |
|
| 416 | */ |
|
| 417 | public function removeCircle($circleUniqueId, bool $force = false) { |
|
| 418 | if ($force) { |
|
| 419 | $circle = $this->circlesRequest->forceGetCircle($circleUniqueId); |
|
| 420 | } else { |
|
| 421 | $circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId); |
|
| 422 | $this->hasToBeOwner($circle->getHigherViewer()); |
|
| 423 | } |
|
| 424 | ||
| 425 | // removing a Circle is done only by owner, so can already be done by local user, or admin, or occ |
|
| 426 | // at this point, we already know that all condition are filled. we can force it. |
|