@@ -128,11 +128,11 @@ public function search(string $search = '', ?string $itemType = null, int $page
128128 $ shareTypes [] = IShare::TYPE_GROUP ;
129129 }
130130
131- if ($ this ->isRemoteSharingAllowed ($ itemType )) {
131+ if ($ this ->isRemoteSharingAllowed ()) {
132132 $ shareTypes [] = IShare::TYPE_REMOTE ;
133133 }
134134
135- if ($ this ->isRemoteGroupSharingAllowed ($ itemType )) {
135+ if ($ this ->isRemoteGroupSharingAllowed ()) {
136136 $ shareTypes [] = IShare::TYPE_REMOTE_GROUP ;
137137 }
138138
@@ -309,11 +309,11 @@ public function findRecommended(string $itemType, $shareType = null): DataRespon
309309 $ shareTypes [] = IShare::TYPE_GROUP ;
310310 }
311311
312- if ($ this ->isRemoteSharingAllowed ($ itemType )) {
312+ if ($ this ->isRemoteSharingAllowed ()) {
313313 $ shareTypes [] = IShare::TYPE_REMOTE ;
314314 }
315315
316- if ($ this ->isRemoteGroupSharingAllowed ($ itemType )) {
316+ if ($ this ->isRemoteGroupSharingAllowed ()) {
317317 $ shareTypes [] = IShare::TYPE_REMOTE_GROUP ;
318318 }
319319
@@ -353,24 +353,12 @@ public function findRecommended(string $itemType, $shareType = null): DataRespon
353353 * @param string $itemType
354354 * @return bool
355355 */
356- protected function isRemoteSharingAllowed (string $ itemType ): bool {
357- try {
358- // FIXME: static foo makes unit testing unnecessarily difficult
359- $ backend = Share::getBackend ($ itemType );
360- return $ backend ->isShareTypeAllowed (IShare::TYPE_REMOTE );
361- } catch (\Exception $ e ) {
362- return false ;
363- }
356+ protected function isRemoteSharingAllowed (): bool {
357+ return $ this ->federatedShareProvider ->isOutgoingServer2serverShareEnabled ();
364358 }
365359
366- protected function isRemoteGroupSharingAllowed (string $ itemType ): bool {
367- try {
368- // FIXME: static foo makes unit testing unnecessarily difficult
369- $ backend = Share::getBackend ($ itemType );
370- return $ backend ->isShareTypeAllowed (IShare::TYPE_REMOTE_GROUP );
371- } catch (\Exception $ e ) {
372- return false ;
373- }
360+ protected function isRemoteGroupSharingAllowed (): bool {
361+ return $ this ->federatedShareProvider ->isOutgoingServer2serverGroupShareEnabled ();
374362 }
375363
376364
0 commit comments