-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46987 from nextcloud/fix/dav-public
fix(dav): Ensure share properties are also set on public remote endpoint
- Loading branch information
Showing
18 changed files
with
179 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
namespace OCA\DAV\Storage; | ||
|
||
use OC\Files\Storage\Wrapper\Wrapper; | ||
use OCP\Files\Storage\ISharedStorage; | ||
use OCP\Share\IShare; | ||
|
||
class PublicShareWrapper extends Wrapper implements ISharedStorage { | ||
|
||
private IShare $share; | ||
|
||
/** | ||
* @param array $arguments ['storage' => $storage, 'share' => $share] | ||
* | ||
* $storage: The storage the permissions mask should be applied on | ||
* $share: The share to use in case no share is found | ||
*/ | ||
public function __construct($arguments) { | ||
parent::__construct($arguments); | ||
$this->share = $arguments['share']; | ||
} | ||
|
||
public function getShare(): IShare { | ||
$storage = parent::getWrapperStorage(); | ||
if (method_exists($storage, 'getShare')) { | ||
/** @var ISharedStorage $storage */ | ||
return $storage->getShare(); | ||
} | ||
|
||
return $this->share; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
Feature: dav-v2-public | ||
Background: | ||
Given using api version "1" | ||
|
||
Scenario: See note to recipient in public shares | ||
Given using new dav path | ||
And As an "admin" | ||
And user "user0" exists | ||
And user "user1" exists | ||
And As an "user1" | ||
And user "user1" created a folder "/testshare" | ||
And as "user1" creating a share with | ||
| path | testshare | | ||
| shareType | 3 | | ||
| permissions | 1 | | ||
| note | Hello | | ||
And As an "user0" | ||
Given using new public dav path | ||
When Requesting share note on dav endpoint | ||
Then the single response should contain a property "{http://nextcloud.org/ns}note" with value "Hello" |
Oops, something went wrong.