Skip to content

Allign WebDAV's <oc:permissions> with ocs permissions on PROPFIND #20426

Closed

Description

@ckamm

With 8.2.0:

  • Have two accounts A, B
  • Share a file <A>/file to <B>/file with all permissions
  • Look at the permissions returned for /file in PROPFIND of <B>/ and <B>/file. Both should be SRDNVW.
  • Remove the edit permissions from the share.
  • Look at the permissions again. The PROPFIND for <B>/file returns SRDNV (correct), but the <B>/file entry in the directory propfind continues to say SRDNVW.

This has the practical implication that the desktop sync client will not have up to date information about the file permissions and will behave incorrectly. owncloud/client#3244

@DeepDiver1975 @PVince81

Activity

  1. added this to the milestone on Nov 10, 2015
  2. rullzer commented on Nov 17, 2015

    @rullzer
    Contributor

    Ah permission mess :)
    The trouble is that we here try to map two different permission sets in 1 field. On the one hand we have the share permissions and on the other hand we have the oc filesystem permissions.

    If you propfind on the root it will see hey there is a mountpoint /file. And it will retrieve the permissions correctly. However because it is a mountpoint in / it will say. Well it is a share so the receiver can always rename (move mountpoint) or delete the file (unshare).

    Now if you do a propfind directly on /file it won't do all this mountpoint magic (since you profind just a file). And thus return the correct permissions.

    So actually this is 2 bugs.

    1. Different permissions
    2. No way to get the proper share permissions
  3. PVince81 commented on Nov 18, 2015

    @PVince81
    Contributor

    From my understanding the sync client only needs the permissions to find out whether or not to attempt a server call. If the permissions are too permissive, it isn't that bad if the sync client needs to make a server call to see it fail afterwards. So it's just a way to save server calls. Correct me if I'm wrong @ckamm 😄

    With that assumption, we could make it so that the "PROPFIND /file" returns the same permissions as the sub-result from "PROPFIND /".

  4. rullzer commented on Nov 18, 2015

    @rullzer
    Contributor

    @PVince81 not exactly. The clients wants to mark files that it can't edit as read only. So the uers will get notified on their system that they can't save the file. Right now they can edit the file just fine. Save it. And then the client will tell them there is a problem when uploading.

  5. PVince81 commented on Nov 18, 2015

    @PVince81
    Contributor

    @icewind1991 can you comment on this ? Was this behavior originally on purpose ?

  6. PVince81 commented on Nov 18, 2015

    @PVince81
    Contributor

    This also means that when we make the web UI use Webdav we might encounter similar issues.

  7. PVince81 commented on Nov 18, 2015

    @PVince81
    Contributor

    Looks like this behavior exists since OC 7 already.

  8. PVince81 commented on Nov 18, 2015

    @PVince81
    Contributor

    I see some perms manipulation here in getDirectoryContents(): https://github.com/owncloud/core/blob/v8.2.0/lib/private/files/view.php#L1362
    That's used by PROPFIND with Depth: 1.

  9. rullzer commented on Nov 18, 2015

    @rullzer
    Contributor

    I see some perms manipulation here in getDirectoryContents(): https://github.com/owncloud/core/blob/master/lib/private/files/view.php#L1370
    That's used by PROPFIND with Depth: 1.

    YES!. When I ran with XDebug yesterday that was the point. Permissions are fine till that point.
    We add those there because it is a mount point (moveable mount point). So we can always move and delete it.

  10. icewind1991 commented on Nov 18, 2015

    @icewind1991
    Contributor

    Then we should also add those permissions to the storage root when doing getFileInfo

  11. 37 remaining items

  12. ownclouders commented on Jan 13, 2018

    @ownclouders
    Contributor

    Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

    (This is an automated comment from GitMate.io.)

  13. SamuAlfageme commented on Feb 6, 2018

    @SamuAlfageme

    See for reference & discussion owncloud/client#6346 (comment)

    The oc:permissions of a "shared with me; cannot edit but can reshare" :

    <oc:permissions>SRDNVW</oc:permissions>

    ... this is returned in both WebDAV endpoints (old & new). Based on client mappings:

    https://github.com/owncloud/client/blob/cedf72825bc0db8e3c147958a9382ee5b411d9ea/src/common/remotepermissions.h#L42-L54

    This is not consistent with the semantics of "Shared with me; can reshare but nothing else".

    For everything to be sound with the files backend behavior, the permissions should be:

    <oc:permissions>SRDV</oc:permissions>

    ... since Rename and Delete operations are also allowed for this file. And to be aligned with the response of of http://localhost/ocs/v2.php/apps/files_sharing/api/v1/shares?format=json&path=/test&shared_with_me=true:

    {
       "ocs":{
          "meta":{
             "status":"ok",
             "statuscode":200,
             "message":null
          },
          "data":[
             {
                "id":"2",
                "share_type":0,
                "uid_owner":"demo",
                "displayname_owner":"demo",
                "permissions":17,
  14. changed the title [-]Stale shared-file permissions returned on directory PROPFIND[/-] [+]Allign WebDAV's <oc:permissions> with ocs permissions on PROPFIND[/+] on Feb 6, 2018
  15. removed their assignment
    on Oct 15, 2018
  16. stale commented on Sep 21, 2021

    @stale

    This issue has been automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions