Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests-Only] refactor permission tests for shares folder #4104

Merged
merged 1 commit into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ config = {
'webUISharingFilePermissionsGroups': 'SharingFilePermissionsGroups',
'webUISharingFolderPermissionsGroups': 'SharingFolderPermissionsGroups',
'webUISharingFolderAdvancedPermissionsGroups': 'SharingFolderAdvPermissionsGrp',
'webUISharingPermissionToRoot': 'SharingPermissionToRoot',
'webUIResharing': 'Resharing',
'webUIResharingToRoot': 'ResharingToRoot',
'webUISharingPublic': 'SharingPublic',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Sharing files with multiple internal users with different permissions
So that I can control the access on those files by other collaborators

Background:
Given these users have been created with default attributes:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
Expand All @@ -28,6 +30,8 @@ Feature: Sharing files with multiple internal users with different permissions
And the user removes "User Four" as a collaborator from the share
And the user removes "Regular User" as a collaborator from the share
And the user shares with the selected collaborators
And user "user2" accepts the share "lorem.txt" offered by user "user1" using the sharing API
And user "user3" accepts the share "lorem.txt" offered by user "user1" using the sharing API
Then custom permissions "<displayed-permissions>" should be set for user "User Two" for file "lorem.txt" on the webUI
And custom permissions "<displayed-permissions>" should be set for user "User Three" for file "lorem.txt" on the webUI
And user "User Two" should be listed as "<displayed-role>" in the collaborators list for file "lorem.txt" on the webUI
Expand All @@ -36,20 +40,20 @@ Feature: Sharing files with multiple internal users with different permissions
| field | value |
| uid_owner | user1 |
| share_with | user2 |
| file_target | /lorem (2).txt |
| file_target | /Shares/lorem.txt |
| item_type | file |
| permissions | <actual-permissions> |
And user "user3" should have received a share with these details:
| field | value |
| uid_owner | user1 |
| share_with | user3 |
| file_target | /lorem (2).txt |
| file_target | /Shares/lorem.txt |
| item_type | file |
| permissions | <actual-permissions> |
But user "Regular User" should not be listed in the collaborators list on the webUI
And as "user0" file "lorem (2).txt" should not exist
And as "user0" file "/Shares/lorem.txt" should not exist
And user "User Four" should not be listed in the collaborators list on the webUI
And as "user4" file "lorem(2).txt" should not exist
And as "user4" file "/Shares/lorem.txt" should not exist
Examples:
| role | displayed-role | extra-permissions | displayed-permissions | actual-permissions |
| Viewer | Viewer | share | share | read, share |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Sharing files with internal groups with permissions
So that I can control the access on those files by other users on the group

Background:
Given these users have been created with default attributes:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
Expand All @@ -30,6 +32,8 @@ Feature: Sharing files with internal groups with permissions
| grp2 | group |
And the user removes "grp1" as a collaborator from the share
And the user shares with the selected collaborators
And user "user2" accepts the share "lorem.txt" offered by user "user1" using the sharing API
And user "user3" accepts the share "lorem.txt" offered by user "user1" using the sharing API
Then custom permissions "<displayed-permissions>" should be set for user "grp2" for file "lorem.txt" on the webUI
And custom permissions "<displayed-permissions>" should be set for user "User Three" for file "lorem.txt" on the webUI
And group "grp2" should be listed as "<displayed-role>" in the collaborators list for file "lorem.txt" on the webUI
Expand All @@ -38,18 +42,18 @@ Feature: Sharing files with internal groups with permissions
| field | value |
| uid_owner | user1 |
| share_with | grp2 |
| file_target | /lorem (2).txt |
| file_target | /Shares/lorem.txt |
| item_type | file |
| permissions | <actual-permissions> |
And user "user3" should have received a share with these details:
| field | value |
| uid_owner | user1 |
| share_with | user3 |
| file_target | /lorem (2).txt |
| file_target | /Shares/lorem.txt |
| item_type | file |
| permissions | <actual-permissions> |
But group "grp1" should not be listed in the collaborators list on the webUI
And as "user1" file "lorem (2).txt" should not exist
And as "user1" file "/Shares/lorem.txt" should not exist
Examples:
| role | displayed-role | extra-permissions | displayed-permissions | actual-permissions |
| Viewer | Viewer | share | share | read, share |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Sharing folders with multiple internal users using advanced permissions
So that I can control the access on those folders by other collaborators

Background:
Given these users have been created with default attributes:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
Expand All @@ -28,6 +30,8 @@ Feature: Sharing folders with multiple internal users using advanced permissions
And the user removes "User Four" as a collaborator from the share
And the user removes "Regular User" as a collaborator from the share
And the user shares with the selected collaborators
And user "user2" accepts the share "simple-folder" offered by user "user1" using the sharing API
And user "user3" accepts the share "simple-folder" offered by user "user1" using the sharing API
Then custom permissions "<displayed-permissions>" should be set for user "User Two" for folder "simple-folder" on the webUI
And custom permissions "<displayed-permissions>" should be set for user "User Three" for folder "simple-folder" on the webUI
And user "User Two" should be listed as "<displayed-role>" in the collaborators list for folder "simple-folder" on the webUI
Expand All @@ -36,20 +40,20 @@ Feature: Sharing folders with multiple internal users using advanced permissions
| field | value |
| uid_owner | user1 |
| share_with | user2 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
And user "user3" should have received a share with these details:
| field | value |
| uid_owner | user1 |
| share_with | user3 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
But user "Regular User" should not be listed in the collaborators list on the webUI
And as "user0" folder "simple-folder (2)" should not exist
And as "user0" folder "/Shares/simple-folder" should not exist
And user "User Four" should not be listed in the collaborators list on the webUI
And as "user4" folder "simple-folder (2)" should not exist
And as "user4" folder "/Shares/simple-folder" should not exist
Examples:
| role | displayed-role | extra-permissions | displayed-permissions | actual-permissions |
| Advanced permissions | Advanced permissions | delete | delete | read, delete |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Sharing folders with internal groups with role as advanced permissions
So that I can control the access on those folders by other users on the group

Background:
Given these users have been created with default attributes:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
Expand All @@ -31,6 +33,8 @@ Feature: Sharing folders with internal groups with role as advanced permissions
And the user removes "grp1" as a collaborator from the share
And the user removes "User One" as a collaborator from the share
And the user shares with the selected collaborators
And user "user2" accepts the share "simple-folder" offered by user "user1" using the sharing API
And user "user3" accepts the share "simple-folder" offered by user "user1" using the sharing API
Then custom permissions "<displayed-permissions>" should be set for user "grp2" for folder "simple-folder" on the webUI
And custom permissions "<displayed-permissions>" should be set for user "User Three" for folder "simple-folder" on the webUI
And group "grp2" should be listed as "<displayed-role>" in the collaborators list for folder "simple-folder" on the webUI
Expand All @@ -39,18 +43,18 @@ Feature: Sharing folders with internal groups with role as advanced permissions
| field | value |
| uid_owner | user1 |
| share_with | grp2 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
And user "user3" should have received a share with these details:
| field | value |
| uid_owner | user1 |
| share_with | user3 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
But group "grp1" should not be listed in the collaborators list on the webUI
And as "user1" folder "simple-folder (2)" should not exist
And as "user1" folder "/Shares/simple-folder" should not exist
Examples:
| role | displayed-role | extra-permissions | displayed-permissions | actual-permissions |
| Advanced permissions | Advanced permissions | delete | delete | read, delete |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Sharing folders with multiple internal users with different permissions
So that I can control the access on those folders by other collaborators

Background:
Given these users have been created with default attributes:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
Expand All @@ -28,6 +30,8 @@ Feature: Sharing folders with multiple internal users with different permissions
And the user removes "User Four" as a collaborator from the share
And the user removes "Regular User" as a collaborator from the share
And the user shares with the selected collaborators
And user "user2" accepts the share "simple-folder" offered by user "user1" using the sharing API
And user "user3" accepts the share "simple-folder" offered by user "user1" using the sharing API
Then custom permissions "<displayed-permissions>" should be set for user "User Two" for folder "simple-folder" on the webUI
And custom permissions "<displayed-permissions>" should be set for user "User Three" for folder "simple-folder" on the webUI
And user "User Two" should be listed as "<displayed-role>" in the collaborators list for folder "simple-folder" on the webUI
Expand All @@ -36,14 +40,14 @@ Feature: Sharing folders with multiple internal users with different permissions
| field | value |
| uid_owner | user1 |
| share_with | user2 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
And user "user3" should have received a share with these details:
| field | value |
| uid_owner | user1 |
| share_with | user3 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
But user "Regular User" should not be listed in the collaborators list on the webUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Feature: Sharing folders with internal groups with different roles and permissio
So that I can control the access on those folders by other users on the group

Background:
Given these users have been created with default attributes:
Given the setting "shareapi_auto_accept_share" of app "core" has been set to "no"
And the administrator has set the default folder for received shares to "Shares"
And these users have been created with default attributes:
| username |
| user1 |
| user2 |
Expand All @@ -31,26 +33,28 @@ Feature: Sharing folders with internal groups with different roles and permissio
And the user removes "grp1" as a collaborator from the share
And the user removes "User One" as a collaborator from the share
And the user shares with the selected collaborators
And user "user2" accepts the share "simple-folder" offered by user "user1" using the sharing API
And user "user3" accepts the share "simple-folder" offered by user "user1" using the sharing API
Then custom permissions "<displayed-permissions>" should be set for user "grp2" for folder "simple-folder" on the webUI
And custom permissions "<displayed-permissions>" should be set for user "User Three" for folder "simple-folder" on the webUI
And group "grp2" should be listed as "<displayed-role>" in the collaborators list for folder "simple-folder" on the webUI
And user "User Three" should be listed as "<displayed-role>" in the collaborators list for folder "simple-folder" on the webUI
And user "user2" should have received a share with these details:
Then user "user2" should have received a share with these details:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then user "user2" should have received a share with these details:
And user "user2" should have received a share with these details:

But not a big deal.

| field | value |
| uid_owner | user1 |
| share_with | grp2 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
And user "user3" should have received a share with these details:
| field | value |
| uid_owner | user1 |
| share_with | user3 |
| file_target | /simple-folder (2) |
| file_target | /Shares/simple-folder |
| item_type | folder |
| permissions | <actual-permissions> |
But group "grp1" should not be listed in the collaborators list on the webUI
And as "user1" folder "simple-folder (2)" should not exist
And as "user1" folder "/Shares/simple-folder" should not exist
Examples:
| role | displayed-role | extra-permissions | displayed-permissions | actual-permissions |
| Viewer | Viewer | share | share | read, share |
Expand Down
Loading