Skip to content

OCS error message for attempting to access share via share id as an unauthorized user is not informative #1233

@Talank

Description

@Talank

While a user tries to get the info of the share using the share id, the ocs status message is Only GET, POST and PUT are allowed if that user is not allowed to access the share.

Steps to reproduce

  1. Create users: Alice and Brian and Carol
  2. User Alice created and shared file toShareWithBrian.txt with the user "Brian"
  3. As user Carol, send a HTTP GET request to the OCS API endpoint /ocs/v2.php/apps/files_sharing/api/v1/shares/<LAST_SHARE_ID>

Expected behavior

The response should be something like that in OC10 in which the ocs status code is 404

Actual behavior (In OCIS)

As user Carol, when HTTP GET request is sent for /ocs/v2.php/apps/files_sharing/api/v1/shares/501b093e-39b9-431c-9234-c343ae215903 where 501b093e-39b9-431c-9234-c343ae215903 is the share id for the share of file toShareWithBrian.txt, I get the following response

<?xml version="1.0" encoding="UTF-8"?>
<ocs>
   <meta>
      <status>error</status>
      <statuscode>400</statuscode>
      <message>Only GET, POST and PUT are allowed</message>
   </meta>
</ocs>

In OC10

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>failure</status>
  <statuscode>404</statuscode>
  <message>Wrong share ID, share doesn't exist</message>
  <totalitems></totalitems>
  <itemsperpage></itemsperpage>
 </meta>
 <data/>
</ocs>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions