-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dav): Ensure share properties are also set on public remote endpoint
Signed-off-by: Ferdinand Thiessen <[email protected]>
- Loading branch information
Showing
9 changed files
with
114 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?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\Share\IShare; | ||
|
||
class PublicShareWrapper extends Wrapper { | ||
Check notice Code scanning / Psalm DeprecatedInterface Note
OCP\Files\Storage is marked deprecated
|
||
|
||
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 \OCA\Files_Sharing\SharedStorage $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
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" |
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