|
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; |
@@ -75,7 +76,10 @@ public function getSharedWith(string $teamId, string $userId): array { |
75 | 76 | return []; |
76 | 77 | } |
77 | 78 |
|
78 | | - if ($this->getTeam($teamId, $userId) === null) { |
| 79 | + $probe = new CircleProbe(); |
| 80 | + $probe->mustBeMember(); |
| 81 | + |
| 82 | + if ($this->getTeam($teamId, $userId, $probe) === null) { |
79 | 83 | return []; |
80 | 84 | } |
81 | 85 |
|
@@ -124,15 +128,15 @@ public function getTeamsForResource(string $providerId, string $resourceId, stri |
124 | 128 | }, $this->getTeams($provider->getTeamsForResource($resourceId), $userId)); |
125 | 129 | } |
126 | 130 |
|
127 | | - private function getTeam(string $teamId, string $userId): ?Circle { |
| 131 | + private function getTeam(string $teamId, string $userId, ?CircleProbe $probe = null): ?Circle { |
128 | 132 | if (!$this->hasTeamSupport()) { |
129 | 133 | return null; |
130 | 134 | } |
131 | 135 |
|
132 | 136 | try { |
133 | 137 | $federatedUser = $this->circlesManager->getFederatedUser($userId, Member::TYPE_USER); |
134 | 138 | $this->circlesManager->startSession($federatedUser); |
135 | | - return $this->circlesManager->getCircle($teamId); |
| 139 | + return $this->circlesManager->getCircle($teamId, $probe); |
136 | 140 | } catch (CircleNotFoundException) { |
137 | 141 | return null; |
138 | 142 | } |
|
0 commit comments