mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 01:52:08 -04:00
fix: use canDownload for permissions on federated shares
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
08495bfc0e
commit
7f8f86ab9a
2 changed files with 3 additions and 4 deletions
|
|
@ -18,7 +18,6 @@ use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
|
|||
use OCP\AppFramework\Http\Attribute\OpenAPI;
|
||||
use OCP\AppFramework\Http\Attribute\PublicPage;
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\Constants;
|
||||
use OCP\Federation\ICloudIdManager;
|
||||
use OCP\HintException;
|
||||
use OCP\Http\Client\IClientService;
|
||||
|
|
@ -108,9 +107,9 @@ class MountPublicLinkController extends Controller {
|
|||
return $response;
|
||||
}
|
||||
|
||||
if (($share->getPermissions() & Constants::PERMISSION_READ) === 0) {
|
||||
if (!$share->canDownload()) {
|
||||
$response = new JSONResponse(
|
||||
['message' => 'Mounting file drop not supported'],
|
||||
['message' => 'Mounting download restricted share is not allowed'],
|
||||
Http::STATUS_BAD_REQUEST
|
||||
);
|
||||
$response->throttle();
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class DefaultPublicShareTemplateProvider implements IPublicShareTemplateProvider
|
|||
|
||||
// Create the header action menu
|
||||
$headerActions = [];
|
||||
if ($view !== 'public-file-drop' && !$share->getHideDownload()) {
|
||||
if ($share->canDownload() && !$share->getHideDownload()) {
|
||||
// The download URL is used for the "download" header action as well as in some cases for the direct link
|
||||
$downloadUrl = $this->urlGenerator->getAbsoluteURL('/public.php/dav/files/' . $token . '/?accept=zip');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue