|
12 | 12 | use OCA\Circles\Exceptions\CircleNotFoundException; |
13 | 13 | use OCA\Circles\Model\Circle; |
14 | 14 | use OCA\Circles\Model\Member; |
| 15 | +use OCA\Circles\Model\Probes\CircleProbe; |
15 | 16 | use OCP\IURLGenerator; |
16 | 17 | use OCP\Server; |
17 | 18 | use OCP\Teams\ITeamManager; |
@@ -71,7 +72,10 @@ public function getSharedWith(string $teamId, string $userId): array { |
71 | 72 | return []; |
72 | 73 | } |
73 | 74 |
|
74 | | - if ($this->getTeam($teamId, $userId) === null) { |
| 75 | + $probe = new CircleProbe(); |
| 76 | + $probe->mustBeMember(); |
| 77 | + |
| 78 | + if ($this->getTeam($teamId, $userId, $probe) === null) { |
75 | 79 | return []; |
76 | 80 | } |
77 | 81 |
|
@@ -118,15 +122,15 @@ public function getTeamsForResource(string $providerId, string $resourceId, stri |
118 | 122 | }, $this->getTeams($provider->getTeamsForResource($resourceId), $userId)); |
119 | 123 | } |
120 | 124 |
|
121 | | - private function getTeam(string $teamId, string $userId): ?Circle { |
| 125 | + private function getTeam(string $teamId, string $userId, ?CircleProbe $probe = null): ?Circle { |
122 | 126 | if (!$this->hasTeamSupport()) { |
123 | 127 | return null; |
124 | 128 | } |
125 | 129 |
|
126 | 130 | try { |
127 | 131 | $federatedUser = $this->circlesManager->getFederatedUser($userId, Member::TYPE_USER); |
128 | 132 | $this->circlesManager->startSession($federatedUser); |
129 | | - return $this->circlesManager->getCircle($teamId); |
| 133 | + return $this->circlesManager->getCircle($teamId, $probe); |
130 | 134 | } catch (CircleNotFoundException) { |
131 | 135 | return null; |
132 | 136 | } |
|
0 commit comments