Skip to content

GET SHARES for a FILE with RESHARES=true does not return Shares owned by other users if the current user does not own any Share on the file #21779

Closed

Description

@davivel

Steps to reproduce

  1. In the web UI, log in as 'admin' and share the folder 'folder' with 'user1'.
  2. Using curl, type: curl -H "OCS-APIREQUEST: true" -u user1:[pass] "[server-base-url]/ocs/v1.php/apps/files_sharing/api/v1/shares?path=folder&reshares=true"

Expected behaviour

Response with code 100 and at least one share, owned by 'admin' and shared with 'user1'

Actual behaviour

Response with code 404 and message "Share doesn't exist"

Server configuration

ownCloud version: (see ownCloud admin page)
ownCloud 8.2.2 (stable)

Updated from an older ownCloud or fresh install:
Fresh

Logs

ownCloud log (data/owncloud.log)

Error OCP\Share Sharing backend for search not found
Error OCP\Share Sharing backend for search not found
Error OCP\Share Sharing backend for search not found

(Seems appear three times)

Extra:

The request works as expected if 'user1' shares 'folder' with 'user2' before, returning all the existing Shares for 'folder'

Activity

  1. nickvergessen commented on Jan 18, 2016

    @nickvergessen
    Contributor

    8.2.1 is not the lastest version of that branch. please try 8.2.2

  2. javiergonzper commented on Jan 19, 2016

    @javiergonzper

    @nickvergessen it also fails on 8.2.2
    If I have a file shared I can not read the individual share until I share again the file with other user:

    curl -X GET -H "OCS-APIREQUEST: true" -u user:password "http://URLSERVER/ocs/v1.php/apps/files_sharing/api/v1/shares?path=/admin.png&reshares=true"

  3. rullzer commented on Jan 19, 2016

    @rullzer
    Contributor

    This is actually expected. Since the share API 'normally' should only returned shares you initiated. We have the shared_with_me for that. which is also not as rock solid at the moment as we would like...

  4. davivel commented on Jan 19, 2016

    @davivel
    Author

    Then what's the use case of the reshares parameter?

    What do you mean with

    We have the shared_with_me for that .

    ?

    Is that another parameter? It's not documented in https://doc.owncloud.org/server/8.2/developer_manual/core/ocs-share-api.html

  5. davivel commented on Jan 19, 2016

    @davivel
    Author

    Tested, parameter 'shared_with_me' in a GET for shares returns all the Shares target of the current user.

    What server version is available this parameter from?

  6. davivel commented on Jan 19, 2016

    @davivel
    Author

    Is there a combo of parameters that returns only the Shares shared with me for a given file? I'm trying to add path and file_target , besides of shared_with_me, but the response includes always all the Shares.

  7. rullzer commented on Jan 19, 2016

    @rullzer
    Contributor

    Yeah it is not documented... and also the behaviour is not quite well defined... so short awnser no. no such combination of parameters exist. And certainly not one that works on the old servers as well.

    We will need to come up with a v2 of the share API for external share providers. So at that point we can design what we want.

  8. rperezb commented on Jan 19, 2016

    @rperezb

    cc @carlaschroder new parameter to include on the documentation

  9. carlaschroder commented on Jan 19, 2016

    @carlaschroder

    Thanks @rperezb!

  10. davivel commented on Jan 22, 2016

    @davivel
    Author

    Well, I don't know if documenting it is the way to go at this point, since @rullzer says

    the behaviour is not quite well defined.

    The key point to me is

    This is actually expected.

    Let me reformulate this to the real problem from the client perspective. Just a minute..

  11. davivel commented on Jan 22, 2016

    @davivel
    Author

    If you are all OK, we could follow the topic in #21855.

  12. lock commented on Aug 6, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  13. locked as resolved and limited conversation to collaborators on Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions