Skip to content

Commit 02fcb5e

Browse files
committed
Add integration tests for default share permissions
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
1 parent 8ebe5a1 commit 02fcb5e

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

build/integration/features/bootstrap/SharingContext.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class SharingContext implements Context, SnippetAcceptingContext {
3737
use CommandLine;
3838

3939
protected function resetAppConfigs() {
40+
$this->modifyServerConfig('core', 'shareapi_default_permissions', '31');
4041
$this->modifyServerConfig('sharebymail', 'enforcePasswordProtection', 'no');
4142
}
4243
}

build/integration/sharing_features/sharing-v1.feature

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,40 @@ Feature: sharing
357357
| url | AN_URL |
358358
| mimetype | httpd/unix-directory |
359359

360+
Scenario: Creating a new share of a file with default permissions
361+
Given user "user0" exists
362+
And user "user1" exists
363+
And As an "user0"
364+
And parameter "shareapi_default_permissions" of app "core" is set to "7"
365+
When creating a share with
366+
| path | welcome.txt |
367+
| shareWith | user1 |
368+
| shareType | 0 |
369+
And the OCS status code should be "100"
370+
And the HTTP status code should be "200"
371+
And Getting info of last share
372+
Then the OCS status code should be "100"
373+
And the HTTP status code should be "200"
374+
And Share fields of last share match with
375+
| permissions | 3 |
376+
377+
Scenario: Creating a new share of a folder with default permissions
378+
Given user "user0" exists
379+
And user "user1" exists
380+
And As an "user0"
381+
And parameter "shareapi_default_permissions" of app "core" is set to "7"
382+
When creating a share with
383+
| path | FOLDER |
384+
| shareWith | user1 |
385+
| shareType | 0 |
386+
And the OCS status code should be "100"
387+
And the HTTP status code should be "200"
388+
And Getting info of last share
389+
Then the OCS status code should be "100"
390+
And the HTTP status code should be "200"
391+
And Share fields of last share match with
392+
| permissions | 7 |
393+
360394
Scenario: getting all shares of a user using that user
361395
Given user "user0" exists
362396
And user "user1" exists

0 commit comments

Comments
 (0)