Skip to content

Commit 9a451c7

Browse files
committed
fixup! fix(SecureView): hide disfunctional *download* files action
1 parent f433197 commit 9a451c7

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

tests/features/bootstrap/RichDocumentsContext.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,26 @@ public function renameFileTo($user, $file, $newName) {
290290

291291
$this->wopiContext->collaboraRenamesTo($fileId, $newName);
292292
}
293+
294+
/**
295+
* @When admin enables secure view
296+
*/
297+
public function enableSecureView(): void {
298+
$this->serverContext->actAsAdmin(function () {
299+
$watermarkKeysToEnable = [
300+
'watermark_enabled',
301+
'watermark_linkAll',
302+
'watermark_shareRead',
303+
];
304+
305+
foreach ($watermarkKeysToEnable as $configKey) {
306+
$this->serverContext->sendOCSRequest(
307+
'POST',
308+
'apps/provisioning_api/api/v1/config/apps/files/' . $configKey,
309+
['value' => 'yes'],
310+
);
311+
$this->serverContext->assertHttpStatusCode(200);
312+
}
313+
});
314+
}
293315
}

tests/features/secure-view.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Feature: API
33
Background:
44
Given user "user1" exists
55
And user "user2" exists
6+
And admin enables secure view
67

78
Scenario: Download button is not shown in public shares
89
Given as user "user1"

tests/run-integration.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ PHPPIDB=$!
5050

5151
$OCC config:app:set richdocuments wopi_url --value="http://localhost:9980"
5252
$OCC config:app:set richdocuments public_wopi_url --value="http://localhost:9980"
53-
$OCC config:app:set files watermark_enabled --value="yes"
54-
$OCC config:app:set files watermark_linkAll --value="yes"
55-
$OCC config:app:set files watermark_shareRead --value="yes"
5653
$OCC richdocuments:activate-config
5754
$OCC config:system:set allow_local_remote_servers --value true --type bool
5855
$OCC config:system:set gs.trustedHosts 0 --value="localhost:$PORT_SERVERA"

0 commit comments

Comments
 (0)