owncloud / ocis

:atom_symbol: ownCloud Infinite Scale Stack
https://doc.owncloud.com/ocis/next/
Apache License 2.0
1.26k stars 169 forks source link

PROPFIND request to resource shared with user when deleted retains it's <oc:share-type> property #9463

Open S-Panta opened 6 days ago

S-Panta commented 6 days ago

Describe the bug

When a resource is shared with a user and propfind is done to that resource from sharer with the body <oc:share-types />, the response will be 0. Even if the user is deleted, the value doesn't change. Same goes with the group. The value becomes empty only when the resource is unshared with the user or group but when they are deleted, the propfind property retains the previous value

Steps to reproduce

  1. Create a user admin and einstein 2.create a folder test 3.Share the folder with einstein
  2. Delete the user einstein
  3. PROPFIND the resources by admin
 curl -k --location --request PROPFIND 'https://host.docker.internal:9200/remote.php/dav/spaces/a9439309-d04d-4855-8e66-aade543fa429%2478d13b96-8de1-4dfa-8886-c932831e6c04/testFolder' \
-uadmin:admin \ 
--data '<d:propfind xmlns:d="DAV:" 
            xmlns:oc="http://owncloud.org/ns" 
            xmlns:ocs="http://open-collaboration-services.org/ns">
    <d:prop>
        <oc:share-types />
    </d:prop>
</d:propfind>
'

Expected behavior

The XML response for sharetype should be empty

Actual behavior

<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
    <d:response>
        <d:href>/remote.php/dav/spaces/a9439309-d04d-4855-8e66-aade543fa429$78d13b96-8de1-4dfa-8886-c932831e6c04/testFolder/</d:href>
        <d:propstat>
            <d:prop>
                <oc:share-types>
                    <oc:share-type>0</oc:share-type>
                </oc:share-types>
            </d:prop>
            <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
    </d:response>

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

```console OCIS_XXX= Infinite Scale 6.0.0+1db4d1031c Community OCIS_YYY=somevalue PROXY_XXX=somevalue ```

Additional context

Add any other context about the problem here.