Commit Graph

68 Commits

Author SHA1 Message Date
Roeland Jago Douma 62bc53143e
Add locking to modifying operation of the OCS Share API
Fixes #17243

This is done in the OCS Share API instead of the share manager since we
want lazy shares in general. However when doing modifying calls via the
OCS Share API it is fine to force real nodes.

* Updated unit tests to work with logging
2016-04-30 10:32:35 +02:00
Roeland Jago Douma 5e9b618604
Translate OCS Share API error messages
For https://github.com/owncloud/core/issues/22209
2016-04-25 11:08:48 +02:00
Roeland Jago Douma db0c3bd535
Fix Share20OCSTest 2016-04-08 15:22:49 +02:00
Thomas Müller d5be21fe81 Merge pull request #23398 from owncloud/block_group_sharing
Allow blocking of group sharing
2016-03-22 21:28:13 +01:00
Roeland Jago Douma 00f48ec37b When the Share API is disabled do not return shares
Fixes #22668

Block everything in the OCS Share API
2016-03-22 19:43:23 +01:00
Roeland Jago Douma e69a09756b Respect disabled group sharing in sharee endpoint
* Fix tests
2016-03-22 17:13:34 +01:00
Roeland Jago Douma 52826d0e24 Block group sharing in API and in share manager
* Fix tests
2016-03-22 17:13:34 +01:00
Roeland Jago Douma 517ef52560 Add mimetype to OCS Share API output
Fixes #23044
2016-03-10 15:41:17 +01:00
Lukas Reschke c353d51810 Remove Scrutinizer Auto Fixer 2016-03-01 17:48:23 +01:00
Lukas Reschke 933f60e314 Update author information
Probably nice for the people that contributed to 9.0 to see themselves in the AUTHORS file :)
2016-03-01 17:25:15 +01:00
Roeland Jago Douma 8924b0a0dc Check correct permissions when resharing
Fixes #22675

Since we only get a share id we do not know the path for the sharer.
Now if we edit a share we start searching for shares for that user of
that node. And deduce the permissions that way.

* Intergration test added
* Fix unit tests
2016-02-29 19:30:14 +01:00
Roeland Jago Douma 0c9c7737b4 Remove delete permissions for read-only federated reshares
An incomming federated share is just a mount point. Therefor if we
request the permissions on the mountpoint DELETE permissions will be
returned (among others). Since we can always remove a mountpoint, update
a mount point.

However now when trying to reshare we will try to reshare with DELETE
permissions. Which is false.

This PR removes the delete permissions if it is a shared storage.

Basically a quick hack.
Fixes #22587
2016-02-25 12:19:38 +01:00
Roeland Jago Douma 670557ffbb Add unit tests for formatShare 2016-02-17 13:55:39 +01:00
Roeland Jago Douma 2aa0b885f6 OCS Share API should not return invalid shares
Since we have lazy shares it can happen that a share is actually
invalid. See https://github.com/owncloud/core/issues/20908

This add checks for the get methods to handle the NotFound exception.
2016-02-17 13:55:39 +01:00
Bjoern Schiessle 11abf2487c add remote server to the result 2016-02-12 15:52:51 +01:00
Roeland Jago Douma a506f9ca3f Respect not allowing outgoing shares 2016-02-08 11:30:48 +01:00
Roeland Jago Douma bec1de8a38 Update OCS Share API to use federated share provider 2016-02-08 11:30:48 +01:00
Roeland Jago Douma ca32778975 Even single shares are returned as array
When fetching a single share using ../shares/<ID> we should still return
an array of shares.

Fixes #22189
2016-02-08 10:11:22 +01:00
Roeland Jago Douma c1841892d0 [Share 2.0] Fix OCS endpoint 2016-02-03 19:25:29 +01:00
Roeland Jago Douma dc32f49c6e [Share 2.0] Use GenericShareException 2016-02-02 14:23:45 +01:00
Roeland Jago Douma 4d7130ad31 [Share 2.0] Add exceptions to OCP 2016-02-02 14:07:11 +01:00
Roeland Jago Douma 2831884e74 Fix OCS unit tests after two share merges
* Use getNode
* Return IShare object so typechecking is happy
2016-01-28 13:17:16 +01:00
Thomas Müller 295de6aad7 Merge pull request #21960 from owncloud/share2_ocs_fix_passing_empty_strings
Share2 ocs fix passing empty strings
2016-01-28 11:58:35 +01:00
Roeland Jago Douma 34e912ab6b [Share 2.0] Fix interfaces and comments
* Made comments more clear
* Removed unneeded methods
* IShares shareTime is now a proper DateTime object
* IShares getPath -> getNode & setPath -> setNode
* Fix unit tests
2016-01-28 07:54:09 +01:00
Roeland Jago Douma 185b9c6edd [Share 2.0] Move IShare to OCP 2016-01-27 22:04:37 +01:00
Roeland Jago Douma 6957917b20 [Share 2.0] Allow using permissions to update link share 2016-01-27 20:36:36 +01:00
Roeland Jago Douma f5c45dfe7b [Share 2.0] Still allow isolated updates
Still allow isolated updates of parameters
2016-01-27 20:36:31 +01:00
Roeland Jago Douma b321ceef60 [Share 2.0] Also handle empty parameter in updateShare
* More sanity checks
* More unit tests
2016-01-27 20:34:06 +01:00
Roeland Jago Douma 35a3432793 [Share 2.0] When passing empty strings don't fail
The password and expiration date can be set to empty strings when
created. This is now handled gracefully.
2016-01-27 20:34:06 +01:00
Roeland Jago Douma d33e578665 [Share 2.0] Add share owner information to OCS Share API 2016-01-15 20:21:47 +01:00
Roeland Jago Douma cbd3050f4c [Share 2.0] Use full share id (providerId:shareId)
Now that we support multiple managers we communicate shares to the
outside as 'providerId:shareId'. This makes sures that id's are unique
when references from the OCS API.

However, since we do not want to break the OCS API v1 we need to
somewhat hack around this.

When we switch to OCS API v2 (which we should when we support more
custom providers). We will change the id to always be the fullShareId.
2016-01-13 16:35:15 +01:00
Thomas Müller 682821c71e Happy new year! 2016-01-12 15:02:18 +01:00
Roeland Jago Douma be8125b8e2 Add unit tests to make sure we do not lower the search 2016-01-12 10:34:38 +01:00
Roeland Jago Douma 527b434cd2 [Sharing 2.0] Do not use static function to get numeric storage id 2016-01-06 14:53:43 +01:00
Roeland Jago Douma 38d3a638ed [Share 2.0] Enable share creation via OCS API 2016-01-06 14:53:43 +01:00
Joas Schilling 5453daab03 More fixes to the docs 2015-12-08 09:11:50 +01:00
Scrutinizer Auto-Fixer 0f1be1b601 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-12-07 20:08:20 +00:00
Joas Schilling 372f54075f Only return the exact match, when it's allowed 2015-12-02 16:01:01 +01:00
Thomas Müller 3bb6dcea64 Apply DB group annotation ... 2015-11-30 10:55:05 +01:00
Roeland Jago Douma 8d309767d7 [Sharing 2.0] Use the rootfolder to get the path of a share
We need to use the rootfolder here since we also other people than the
shareOwner can request a share.
2015-11-24 10:26:36 +01:00
Roeland Jago Douma ab02b5c36e [Sharing 2.0] Move authentication to the OCS API 2015-11-24 10:26:36 +01:00
Roeland Jago Douma aeae73b364 [Sharing 2.0] Removed unused DI stuff
The share manager etc should not care about filtering stuff. They should
return what is asked for them.
2015-11-24 10:26:36 +01:00
Roeland Jago Douma 1e9fc33212 [Share2.0] OCS Share API getShare uses new code 2015-11-16 13:32:28 +01:00
Roeland Jago Douma 6624fa212a The new sharing code now handles deletion
OCS -> ShareManager -> DefaultShareProvider
2015-11-05 15:59:09 +01:00
Lukas Reschke 8f09d5b67c Update license headers 2015-10-26 14:04:01 +01:00
Morris Jobke b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Joas Schilling 19e7a08cbf Do not allow user enumeration if the config is disabled 2015-09-23 15:11:02 +02:00
Joas Schilling 754850f473 Fix status code 2015-09-15 15:51:54 +02:00
Joas Schilling aa8b1b2894 Throw an error when the page count or perPage setting is invalid 2015-09-15 15:04:04 +02:00
Joas Schilling 665716095b Fix parameter name to match the specs 2015-09-15 12:14:14 +02:00