Commit graph

339 commits

Author SHA1 Message Date
Robin Appelman
41f9946272 clear hooks for tests 2015-10-06 11:38:41 +02:00
Robin Appelman
0817024e6f Mark shares as dirty when changing permissions 2015-10-06 11:38:41 +02:00
Morris Jobke
b945d71384 update licence headers via script 2015-10-05 21:15:52 +02:00
Thomas Müller
710b7dd81c Merge pull request #19487 from owncloud/split_share_middleware
Split files_sharing middelware
2015-10-05 10:57:11 +02:00
Roeland Jago Douma
4adc78b78b Fix and extend unit tests 2015-10-02 12:45:52 +02:00
Roeland Jago Douma
3d2acb5003 sharingcheckmiddleware now handles externalshares as well
Added new annotations for the externalsharescontroller class
* @NoOutgoingFederatedSharingRequired
* @NoIncomingFederatedSharingRequired

By default both are required for all functions in the
externalSharesController.

A proper exception is thrown and then a 405 is returned instead of the
default error page. Since it is only an API endpoint this makes more
sense.

Unit tests added and updated
2015-10-02 12:03:53 +02:00
Roeland Jago Douma
dc38e674a5 Split files_sharing middelware
Since for external shares there is no need for link shares to be enabled
we should check which controller is actually being called.

This makes sure that in all cases we verify that the files_sharing app
is enabled. But only for the share controller (public shares) we check
if the API is enabled and if links are enabled.

TODO: add checks for federated sharing as well
2015-10-02 11:56:11 +02:00
Joas Schilling
17ab8e6c39 Use shorter text on the sidebar for files_sharing activities 2015-10-02 10:01:33 +02:00
Lukas Reschke
22e724e829 Only intercept exceptions of type "NotFoundException" instead of any Exception
The sharing backend may throw another exception for example when the activity app encounters a problem. Previously this just triggered a 404 error page and the exception got not logged at all. With this change such exceptions get not intercepted and regularly handled as exceptions so that we have meaningful log data. Also the user will be shown a window informing him that an error happened.

Helps to debug cases such as https://github.com/owncloud/core/issues/19465
2015-09-30 13:32:20 +02:00
Vincent Petry
d47d240a35 Still show share link when recipient but no share permission
This makes it possible for the recipient to still trigger the sidebar
and share tab to see information about the share.

In the case where the file is not shared and no permissions exists, no
action icon will be displayed.
2015-09-28 16:23:33 +02:00
Roeland Jago Douma
db02173627 Reflect enabled shareAPI in capabilities
If the shareAPI is disabled we not return the other sharing
capabilities.

This allows clients to properly check if sharing is even available.
2015-09-25 20:12:41 +02:00
Joas Schilling
19e7a08cbf Do not allow user enumeration if the config is disabled 2015-09-23 15:11:02 +02:00
Roeland Jago Douma
4dba046712 Respect disabled sharing API settings
If the sharing API setting is disabled that sharing check middle ware
should block the request. Thus making link shares unavailable.
Fixes #18970

* Unit test added
* Unit tests updated
2015-09-22 15:12:16 +02:00
Lukas Reschke
36ce254ffd Move dummy backend to Tests namespace 2015-09-22 11:01:11 +02:00
Thomas Müller
93eb73b0bb Merge pull request #18986 from owncloud/federated_capabilities
Expose federated sharing capabilities to authenticated users
2015-09-18 11:58:54 +02:00
Thomas Müller
4cff2f1ab3 Merge pull request #19046 from owncloud/issue-18924-throw-error-on-invalid-page
Throw an error when the page count or perPage setting is invalid
2015-09-17 13:02:14 +02:00
Vincent Petry
886f1ed660 Update JS unit tests for share dialog (WIP) 2015-09-16 07:23:29 +02:00
Joas Schilling
754850f473 Fix status code 2015-09-15 15:51:54 +02:00
Roeland Jago Douma
91dfcab055 Expose federated sharing capabilities to authenticated users 2015-09-15 15:10:13 +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
Joas Schilling
805f1d0096 Scrap the notifications when the share is accepted or declined 2015-09-08 09:01:01 +02:00
Björn Schießle
39bd4ea8f2 Merge pull request #18234 from owncloud/ocs_api_for_sharees_list
Add OCS API for sharees list
2015-09-01 17:09:57 +02:00
Roeland Jago Douma
d54b497ade Return permissions and expiration on create share responses
Updated and added unit tests
2015-08-30 15:42:19 +02:00
Roeland Jago Douma
2aff11c80b Actually validate the expire date on share
* Added more intergration tests
2015-08-30 10:31:43 +02:00
Roeland Jago Douma
fc64ea670d Allow to directly set the expireDate on a new (link)share
Since this extends the API we now properly parse the date. We only
accept valid ISO 8601 Dates (YYYY-MM-DD).

Currently this only works for link shares (it is just ignored for other
shares). Since we do not have user/group/federated expiring shares yet.

* Tests added
2015-08-29 12:39:47 +02:00
Joas Schilling
199d1dc239 Bring the coverage back to 100% 2015-08-26 11:54:25 +02:00
Joas Schilling
2a6e676048 Adjust tests 2015-08-26 11:54:25 +02:00
Joas Schilling
ac8941f6ac Manually query for the last id 2015-08-26 11:54:25 +02:00
Joas Schilling
f4186d3dfc Fix wrong value for datetime field 2015-08-26 11:54:25 +02:00
Joas Schilling
937586a3f0 Rename file to match the class name 2015-08-26 11:54:25 +02:00
Joas Schilling
6b69e7b1da Add tests for "getShareesForShareIds()" 2015-08-26 11:54:25 +02:00
Joas Schilling
83b88c9a26 Do not return the current user himself 2015-08-26 11:54:25 +02:00
Joas Schilling
0227cfff08 Take a list of share IDs instead of the user and group names 2015-08-26 11:54:25 +02:00
Joas Schilling
5c4fbf5191 Inject the logger as well 2015-08-26 11:54:25 +02:00
Joas Schilling
a0ab7a2578 Add all possible links next, prev, first and last 2015-08-26 11:54:25 +02:00
Joas Schilling
c6ed40c9f8 Make shareType an array 2015-08-26 11:54:24 +02:00
Joas Schilling
068a81897e Add tests for "search()" 2015-08-26 11:54:24 +02:00
Joas Schilling
327c47a989 Do not use deprecated method in new code 2015-08-26 11:54:24 +02:00
Joas Schilling
3f64e9423b Split logic and global usage and add tests for "searchSharees()" 2015-08-26 11:54:24 +02:00
Joas Schilling
16e5c15c28 Add tests for "getRemote()" 2015-08-26 11:54:24 +02:00
Joas Schilling
ad450d4f0e Add tests for "getGroups()" 2015-08-26 11:54:24 +02:00
Joas Schilling
be257bc9cc Add tests for "getUsers()" 2015-08-26 11:54:24 +02:00
Joas Schilling
9b0058d2b0 Move test file to subdir 2015-08-26 11:54:24 +02:00
Roeland Jago Douma
b2fbecc39f Empty skeleton for tests 2015-08-26 11:54:24 +02:00
Morris Jobke
202af1e322 fix unit tests 2015-08-26 11:39:22 +02:00
Lukas Reschke
0a1d551090 Use IClientService to check for remote ownCloud instances
1. Allows to set a timeout (though still not perfect but way better than before)
2. Allows to have unit tests
3. I also added unit tests for the existing controller code
4. Corrected PHPDoc on IClient
2015-08-22 14:39:43 +02:00
Roeland Jago Douma
dce5d9b5d1 Add public upload to capability 2015-08-14 20:03:32 +02:00
Thomas Müller
ddc7f668e5 Merge pull request #18271 from owncloud/issue-18261-sharing-capabilities-use-wrong-default
Fix default values of sharing capabilities
2015-08-14 12:23:06 +02:00
Joas Schilling
20d8576d3d Fix config map provider for tests 2015-08-13 13:07:49 +02:00