Skip to content

Metadata must be set a editable for PROPPATCH - #41390

Merged
AndyScherzinger merged 1 commit into
masterfrom
enh/noid/limit-proppatch-metadata
Nov 14, 2023
Merged

Metadata must be set a editable for PROPPATCH#41390
AndyScherzinger merged 1 commit into
masterfrom
enh/noid/limit-proppatch-metadata

Conversation

@ArtificialOwl

@ArtificialOwlArtificialOwl commented Nov 11, 2023

Copy link
Copy Markdown
Member

With the implementation of metadata and its compatibility with webdav PROPPATCH request, and to avoid unexpected behavior, 2 things needs to be implemented:

  • manage a list of remotely editable metadata,
  • compare edit permissions on metadata and actual rights on file for initiator

throws exception on fail, might be better to just log a warning but keep the process running ?

@ArtificialOwlArtificialOwl added the 2. developing Work in progress label Nov 11, 2023
@ArtificialOwlArtificialOwl added this to the Nextcloud 28 milestone Nov 11, 2023
@ArtificialOwlArtificialOwl added the 3. to review Waiting for reviews label Nov 11, 2023
* Disable modification of the displayname property for files and
* folders via PROPPATCH. See PROPFIND for more information.
*/
$propPatch->handle(self::DISPLAYNAME_PROPERTYNAME, function ($displayName) {

Check notice

Code scanning / Psalm

MissingClosureParamType

Parameter $displayName has no provided type
Comment threadapps/dav/lib/Connector/Sabre/FilesPlugin.php Fixed
@ArtificialOwl
ArtificialOwlforce-pushed the enh/noid/limit-proppatch-metadata branch from 8235cdc to 9cac531CompareNovember 11, 2023 11:56
Comment threadapps/dav/lib/Connector/Sabre/FilesPlugin.php Fixed
@ArtificialOwl
ArtificialOwlforce-pushed the enh/noid/limit-proppatch-metadata branch from 9cac531 to 76b44a5CompareNovember 11, 2023 12:10
Comment threadapps/dav/lib/Connector/Sabre/FilesPlugin.php Fixed
@ArtificialOwl

Copy link
Copy Markdown
MemberAuthor

cypress error not related

@blizzzblizzz mentioned this pull request Nov 13, 2023
@ArtificialOwl
ArtificialOwlforce-pushed the enh/noid/limit-proppatch-metadata branch 2 times, most recently from 1ebc2e1 to e25ebe6CompareNovember 13, 2023 17:09
Comment threadlib/private/FilesMetadata/Model/FilesMetadata.php Fixed
Comment threadlib/private/FilesMetadata/Model/FilesMetadata.php Fixed
Comment threadlib/private/FilesMetadata/Model/MetadataValueWrapper.php Fixed
Comment threadlib/private/FilesMetadata/Model/MetadataValueWrapper.php Fixed
@ArtificialOwl
ArtificialOwlforce-pushed the enh/noid/limit-proppatch-metadata branch 2 times, most recently from 11395c9 to 8e4f8e9CompareNovember 13, 2023 17:38
@ArtificialOwl

Copy link
Copy Markdown
MemberAuthor

cypress error does not seems related

@ArtificialOwl
ArtificialOwlforce-pushed the enh/noid/limit-proppatch-metadata branch 3 times, most recently from edd8494 to b9f5552CompareNovember 14, 2023 08:12
Comment threadlib/public/FilesMetadata/Model/IMetadataQuery.php Outdated
@ArtificialOwl
ArtificialOwlforce-pushed the enh/noid/limit-proppatch-metadata branch 2 times, most recently from 61a26fc to a460d61CompareNovember 14, 2023 11:01
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
@blizzz
blizzzforce-pushed the enh/noid/limit-proppatch-metadata branch from a460d61 to 847c687CompareNovember 14, 2023 13:38

@come-nccome-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small improvements needed on phpdoc for the EDIT_* enum

* @param string $key metadata key
*
* @inheritDoc
* @return int edit permission

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return int edit permission
* @return IMetadataValueWrapper::EDIT_* edit permission level

* @param string $key metadata key
* @param string $type metadata type
* @param bool $indexed TRUE if metadata can be search
* @param int $editPermission remote edit permission via Webdav PROPPATCH

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param int$editPermission remote edit permission via Webdav PROPPATCH
* @param IMetadataValueWrapper::EDIT_*$editPermission remote edit permission level via Webdav PROPPATCH

* (Webdav PROPPATCH)
*
* @param string $key metadata key
* @param int $permission remote edit permission

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param int$permission remote edit permission
* @param IMetadataValueWrapper::EDIT_*$permission remote edit permission level

*
* @param string $key metadata key
*
* @return int

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return int
* @return IMetadataValueWrapper::EDIT_* edit permission level

* set remote edit permission
* (Webdav PROPPATCH)
*
* @param int $permission edit permission

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param int$permission edit permission
* @param IMetadataValueWrapper::EDIT_*$permission edit permission level

* get remote edit permission
* (Webdav PROPPATCH)
*
* @return int edit permission

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return int edit permission
* @return IMetadataValueWrapper::EDIT_* edit permission level

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me do this on a separated PR, post merge

@AndyScherzinger
AndyScherzinger merged commit 93ea634 into masterNov 14, 2023
@AndyScherzinger
AndyScherzinger deleted the enh/noid/limit-proppatch-metadata branch November 14, 2023 16:17
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developingWork in progress3. to reviewWaiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ArtificialOwl@AndyScherzinger@artonge@github-advanced-security@come-nc