API share returns the shares that I make even API is disabled #22668

Closed
mRoRo opened this Issue Feb 26, 2016 · 4 comments

Projects

None yet

7 participants

@mRoRo
mRoRo commented Feb 26, 2016

Steps to reproduce

  1. Share files/folders with local user
  2. Disable the API share
  3. Request the list of shares by path

Expected behaviour

The server does not return the list of shares I've made like in OC 8.2.2:

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>100</statuscode>
  <message/>
 </meta>
 <data/>
</ocs>

Actual behaviour

The server with the disabled share API returns the shares that I had made in OC 9:

<?xml version="1.0" encoding="UTF-8"?>
<ocs>
   <meta>
      <status>ok</status>
      <statuscode>100</statuscode>
      <message />
   </meta>
   <data>
      <element>
         <id>19</id>
         <share_type>6</share_type>
         <uid_owner>maria1</uid_owner>
         <displayname_owner>maria1</displayname_owner>
         <permissions>9</permissions>
         <stime>1456403728</stime>
         <parent />
         <expiration />
         <token>CXnzcLXsF6xq3iL</token>
         <uid_file_owner>maria1</uid_file_owner>
         <displayname_file_owner>maria1</displayname_file_owner>
         <path>/Documents</path>
         <item_type>folder</item_type>
         <storage_id>home::maria1</storage_id>
         <storage>7</storage>
         <item_source>24</item_source>
         <file_source>24</file_source>
         <file_parent>23</file_parent>
         <file_target />
         <share_with>maria@XXXXXXXXX</share_with>
         <share_with_displayname>maria@XXXXXXXX</share_with_displayname>
         <mail_send>0</mail_send>
      </element>
      <element>
         <id>6</id>
         <share_type>6</share_type>
         <uid_owner>maria1</uid_owner>
         <displayname_owner>maria1</displayname_owner>
         <permissions>7</permissions>
         <stime>1456394790</stime>
         <parent />
         <expiration />
         <token>FqQ4B2uOi9EbGan</token>
         <uid_file_owner>maria1</uid_file_owner>
         <displayname_file_owner>maria1</displayname_file_owner>
         <path>/Photos</path>
         <item_type>folder</item_type>
         <storage_id>home::maria1</storage_id>
         <storage>7</storage>
         <item_source>26</item_source>
         <file_source>26</file_source>
         <file_parent>23</file_parent>
         <file_target />
         <share_with>maria@XXXXXXXX</share_with>
         <share_with_displayname>maria@XXXXXXXX</share_with_displayname>
         <mail_send>0</mail_send>
      </element>
      <element>
         <id>1</id>
         <share_type>0</share_type>
         <uid_owner>maria1</uid_owner>
         <displayname_owner>maria1</displayname_owner>
         <permissions>31</permissions>
         <stime>1456392268</stime>
         <parent />
         <expiration />
         <token />
         <uid_file_owner>maria1</uid_file_owner>
         <displayname_file_owner>maria1</displayname_file_owner>
         <path>/carpeta de maria1</path>
         <item_type>folder</item_type>
         <storage_id>home::maria1</storage_id>
         <storage>7</storage>
         <item_source>36</item_source>
         <file_source>36</file_source>
         <file_parent>23</file_parent>
         <file_target>/carpeta de maria1</file_target>
         <share_with>admin</share_with>
         <share_with_displayname>admin</share_with_displayname>
         <mail_send>0</mail_send>
      </element>
      <element>
         <id>3</id>
         <share_type>0</share_type>
         <uid_owner>maria1</uid_owner>
         <displayname_owner>maria1</displayname_owner>
         <permissions>19</permissions>
         <stime>1456392300</stime>
         <parent />
         <expiration />
         <token />
         <uid_file_owner>maria1</uid_file_owner>
         <displayname_file_owner>maria1</displayname_file_owner>
         <path>/tutorial.pdf</path>
         <item_type>file</item_type>
         <storage_id>home::maria1</storage_id>
         <storage>7</storage>
         <item_source>30</item_source>
         <file_source>30</file_source>
         <file_parent>23</file_parent>
         <file_target>/tutorial.pdf</file_target>
         <share_with>admin</share_with>
         <share_with_displayname>admin</share_with_displayname>
         <mail_send>0</mail_send>
      </element>
      <element>
         <id>2</id>
         <share_type>3</share_type>
         <uid_owner>maria1</uid_owner>
         <displayname_owner>maria1</displayname_owner>
         <permissions>1</permissions>
         <stime>1456392280</stime>
         <parent />
         <expiration />
         <token>oaryYogLWndisKv</token>
         <uid_file_owner>maria1</uid_file_owner>
         <displayname_file_owner>maria1</displayname_file_owner>
         <path>/tutorial.pdf</path>
         <item_type>file</item_type>
         <storage_id>home::maria1</storage_id>
         <storage>7</storage>
         <item_source>30</item_source>
         <file_source>30</file_source>
         <file_parent>23</file_parent>
         <file_target>/tutorial.pdf</file_target>
         <share_with />
         <share_with_displayname />
         <url>http://XXXXXXXX</url>
         <mail_send>0</mail_send>
      </element>
   </data>
</ocs>

Server version:
{"installed":true,"maintenance":false,"version":"9.0.0.13","versionstring":"9.0.0 beta 2","edition":""}

@mRoRo mRoRo added this to the 9.0.1-next-maintenance milestone Feb 26, 2016
@rullzer
Contributor
rullzer commented Feb 26, 2016

So I admit it is a change of behaviour.
But I would argue that the old behaviour is wrong and a bug. If the sharing is disabled you should not get any shares back. @schiesbn

@javiergonzper
Member

Yes @rullzer , that it is what I think. If the API is disabled and at the end the files are not shared the API should not return the list of shares.

@schiessle
Member

I agree that it makes sense to not return the shares if the API is disabled. But the "Actual behaviour" in the report indicates that we return the shares.

@rullzer
Contributor
rullzer commented Feb 26, 2016

O warg... I misread 😕

I'll fix this...

@rullzer rullzer self-assigned this Feb 26, 2016
@rullzer rullzer added a commit that referenced this issue Feb 26, 2016
@rullzer rullzer When the Share API is disabled do not return shares
Fixes #22668

When the share API is disabled we should not return shares.
e73f8cd
@rullzer rullzer added a commit that referenced this issue Feb 29, 2016
@rullzer rullzer When the Share API is disabled do not return shares
Fixes #22668

Block everything in the OCS Share API
a25c9ee
@rullzer rullzer added a commit that referenced this issue Feb 29, 2016
@rullzer rullzer When the Share API is disabled do not return shares
Fixes #22668

Block everything in the OCS Share API
2cebd46
@rullzer rullzer added a commit that referenced this issue Mar 4, 2016
@rullzer rullzer When the Share API is disabled do not return shares
Fixes #22668

Block everything in the OCS Share API
fcc215d
@rullzer rullzer added a commit that referenced this issue Mar 7, 2016
@rullzer rullzer When the Share API is disabled do not return shares
Fixes #22668

Block everything in the OCS Share API
f12b030
@rullzer rullzer added a commit that referenced this issue Mar 22, 2016
@rullzer rullzer When the Share API is disabled do not return shares
Fixes #22668

Block everything in the OCS Share API
00f48ec
@rullzer rullzer added a commit that referenced this issue Mar 22, 2016
@rullzer rullzer When the Share API is disabled do not return shares
Fixes #22668

Block everything in the OCS Share API
7fb32f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment