From c3090137a1a481a3620bf705e32e37254b34c24b Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Fri, 20 Jun 2025 09:44:05 +0545 Subject: [PATCH] add test for SpaceEditorWithoutTrashbin role --- tests/acceptance/TestHelpers/GraphHelper.php | 1 + .../SpaceEditorWithoutTrashbin.feature | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/acceptance/features/apiSharingNgAdditionalShareRole/SpaceEditorWithoutTrashbin.feature diff --git a/tests/acceptance/TestHelpers/GraphHelper.php b/tests/acceptance/TestHelpers/GraphHelper.php index a1511603788..775d146b313 100644 --- a/tests/acceptance/TestHelpers/GraphHelper.php +++ b/tests/acceptance/TestHelpers/GraphHelper.php @@ -49,6 +49,7 @@ class GraphHelper { 'Viewer With ListGrants' => 'd5041006-ebb3-4b4a-b6a4-7c180ecfb17d', 'Editor With ListGrants' => 'e8ea8b21-abd4-45d2-b893-8d1546378e9e', 'File Editor With ListGrants' => 'c1235aea-d106-42db-8458-7d5610fb0a67', + 'Space Editor Without Trashbin' => '8f4701d9-c68f-4109-a482-88e22ee32805', ]; public const SHARING_LINK_TYPE_MAPPINGS = [ diff --git a/tests/acceptance/features/apiSharingNgAdditionalShareRole/SpaceEditorWithoutTrashbin.feature b/tests/acceptance/features/apiSharingNgAdditionalShareRole/SpaceEditorWithoutTrashbin.feature new file mode 100644 index 00000000000..9ef6a6b9ff3 --- /dev/null +++ b/tests/acceptance/features/apiSharingNgAdditionalShareRole/SpaceEditorWithoutTrashbin.feature @@ -0,0 +1,26 @@ +@env-config +Feature: an user shares resources + As a user + I don't want space editor to access deleted files + So that they can't restore them + + + Scenario: sharee checks trashbin after file is deleted + Given these users have been created with default attributes: + | username | + | Alice | + | Brian | + And using spaces DAV path + And the administrator has enabled the permissions role "Space Editor Without Trashbin" + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "new-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "new-space" with content "hello world" to "textfile.txt" + And user "Alice" has sent the following space share invitation: + | space | new-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | Space Editor Without Trashbin | + And user "Brian" has removed the file "textfile.txt" from space "new-space" + When user "Brian" lists all deleted files in the trash bin of the space "new-space" + Then the HTTP status code should be "403" + And as "Alice" file "textfile.txt" should exist in the trashbin of the space "new-space"