Commit Graph

148 Commits

Author SHA1 Message Date
Joas Schilling
aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-11-23 10:36:13 +01:00
Robin Appelman
64f62f7cfd
Merge pull request #39863 from nextcloud/sharing-mask-wrapper
move share permission logic to storage wrapper
2023-09-04 14:05:14 +02:00
John Molakvoæ (skjnldsv)
f828dce597
Fix sharing creation insert and get
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2023-09-02 10:25:24 +02:00
Benjamin Gaussorgues
303dadfaa9
sharebymail: remove ILogger and upgrade to PHP 8 syntax
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2023-08-30 18:36:29 +02:00
Côme Chilliet
fd0de0a2d1 Fix tests, add test for the new feature
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-08-28 09:40:12 +02:00
Robin Appelman
e73889a240 cleanup di for share permissions wrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2023-08-16 15:25:05 +02:00
Joas Schilling
cebf93d4d2
fix: Remove legacy dispatcher from share manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-28 14:11:20 +02:00
Joas Schilling
8ad94cbfda
feat!: Migrate unShare events to typed events
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-28 14:11:20 +02:00
Joas Schilling
44b810bfbd
feat!: Migrate Sharing events to typed events
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-28 14:11:19 +02:00
Joas Schilling
c67c067ee7
fix: Move Sharing events to IEventDispatcher
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-27 09:57:53 +02:00
Joas Schilling
6d076c1ee9
fix(dispatcher): Migrate to OCP event dispatcher before symfony/event-dispatcher upgrade
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-06-02 08:08:24 +02:00
jld3103
d9f8522003
Fix types for reading and writing config values
Signed-off-by: jld3103 <jld3103yt@gmail.com>
2023-04-05 09:08:56 +02:00
Côme Chilliet
f5c361cf44
composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2023-01-20 11:45:08 +01:00
Joas Schilling
2f7a1fca5f
Merge pull request #34477 from nextcloud/bugfix/noid/sharee-recommendations-show-group-id
Show group name instead of group id as recommendation
2022-12-09 22:39:28 +01:00
Côme Chilliet
c79a6b3f62
Fix errors from PHP 8.2 testing
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-11-14 17:08:21 +01:00
Joas Schilling
e674087ebf
Adjust unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-10-12 16:03:57 +02:00
Côme Chilliet
6f80fe6ada
Remove deprecated at matcher from tests/lib
Only 15 warnings left in there

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-08-29 16:36:40 +02:00
Julien Veyssier
acc68e9f93
fix share manager tests
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
2022-08-02 01:35:10 +02:00
Vincent Petry
03b1791cca
Fix share attribute related tests + code style
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-07-28 16:53:22 +02:00
Vincent Petry
a95c19e14b
Add share attributes + prevent download permission
Makes it possible to store download permission

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2022-07-28 16:53:22 +02:00
Richard Steinmetz
c1f054a9e0
Fix email shares not being shown to other users
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2022-06-17 17:31:26 +02:00
Vincent Petry
b8b4d247b4
Merge pull request #31194 from nextcloud/feat/allow-to-exclude-groups-from-password-enforcement
Allow to disable password policy enforcement for selected groups
2022-04-06 10:13:23 +02:00
Carl Schwan
a29251e02d Allow to disable password policy enforcement for selected groups
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Co-authored-by: Vincent Petry <vincent@nextcloud.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2022-04-05 17:04:17 +00:00
Côme Chilliet
61f7f13bd8
Migrate from ILogger to LoggerInterface where needed in the tests
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:26 +01:00
Carl Schwan
6312c0df69
Check style update
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-01-13 00:19:07 +01:00
Joas Schilling
3b91e4cc48
Add unit test for share enumeration method
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-09 14:42:57 +01:00
Joas Schilling
fa036b2001
Move common logic to share manager
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-09 10:10:53 +01:00
szaimen
4570bb4f65 Admin Audit - Sharing: createShare - report the full path
Signed-off-by: szaimen <szaimen@e.mail.de>
2021-07-22 14:20:05 +00:00
Gary Kim
b78f3a57d1
Migrate HintException to OCP
Signed-off-by: Gary Kim <gary@garykim.dev>
2021-06-30 15:28:02 -04:00
Morris Jobke
f1dbabd910
Merge pull request #26727 from nextcloud/group-exclude-link-share
Add option to exclude groups from creating link shares
2021-05-21 15:35:39 +02:00
Valdnet
1627eb45bb
l10n: Fix test 2021-05-20 09:26:38 +02:00
Robin Appelman
b1dca57a1c
load share settings from the share manager in more places
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-05-12 16:11:28 +02:00
Joas Schilling
79ebc7f24c
Fix test by defining plurals
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-04-20 16:43:43 +02:00
Vincent Petry
af61486aea
Separate settings for remote share expiration
Added separate settings for default and enforced expiration date for
remote shares.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-04-15 10:06:09 +02:00
Arthur Schiwon
be3ae9a44b
gracefully handle deleteFromSelf when share is already gone
- handling race conditions

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2021-03-30 12:59:40 +02:00
John Molakvoæ (skjnldsv)
15767643f2
Fix sharebymail tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-03-22 06:50:47 +01:00
Daniel Calviño Sánchez
f99876997a
Remove duplicated query for email shares
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
2021-03-22 06:50:47 +01:00
Roeland Jago Douma
1286848731
Merge pull request #23718 from nextcloud/already-shared-error-message
expand 'path is already shared' error message
2021-03-19 13:39:22 +01:00
Vincent Petry
a9e3d2a10f
Update user share must use correct expiration validation
Updating a user or group share now uses the correct method for the
validation of the expiration date. Instead of using the one from links
it uses the one for internal shares.

To avoid future confusion, the method "validateExpirationDate" has been
renamed to "validateExpirationDateLink".

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
2021-03-18 17:12:28 +01:00
Robin Appelman
a550649708
expand 'path is already shared' error message
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-03-15 15:55:08 +01:00
Robin Appelman
e511a539b7
adjust tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
2021-01-26 15:55:38 +01:00
Maxence Lange
e0bafb7475
deleteChildren only returns array
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2020-12-23 11:00:47 +01:00
Julius Härtl
85e6cbc87a
Extend dummy factory in tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-09 13:20:25 +01:00
Daniel Calviño Sánchez
4d3cb1533e Add unit tests for "validateExpirationDateInternal"
They were copied and adjusted as needed from the tests for
"validateExpirationDate".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-16 08:54:19 +01:00
Daniel Calviño Sánchez
baaaacd650 Add explicit time to test date for clarity
This shows in a clearer way that the expected expiration date is the
original one, but without time.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-12 11:57:34 +01:00
Daniel Calviño Sánchez
578b57837a Add unit test for expiration date with date and with default
This adds back what was being actually tested in the unit test fixed in
the previous commit.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-12 11:57:34 +01:00
Daniel Calviño Sánchez
70018ddabf Fix unit test for expiration date without date but with default
The expiration date was explicitly given, so it was not testing what it
should. Moreover, "link_defaultExpDays" needs to be mapped when testing
the default value (even if it will just fallback to the value of
"shareapi_expire_after_n_days").

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-12 11:57:32 +01:00
Daniel Calviño Sánchez
3a53c2b6e5 Fix unit test method name
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-12 11:57:31 +01:00
Daniel Calviño Sánchez
e997f0fa46 Fix unit test for verifying enforced valid expiration date.
The enforced expiration date was not actually enabled, as for that
"shareapi_default_expire_date" needs to be explicitly set to "yes".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-12 11:57:31 +01:00
Daniel Calviño Sánchez
8f1fff40e8 Fix unit test for verifying enforced expire date too far in the future
The test should fail if no exception was thrown, and no exception was
thrown due to a missing configuration parameter. However, the use of
"addToAssertionCount(1)" made the test pass even if no exception was
thrown and, therefore, to silently fail.

Now the missing configuration parameter was added and the test will fail
if the expected exception is not thrown.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-11-12 11:57:29 +01:00