@@ -5,6 +5,7 @@ Feature: APIv2
55 Given user "participant1-v2" exists
66 Given user "participant2-v2" exists
77 Given user "participant3-v2" exists
8+ Given user "participant4-v2" exists
89
910 @api2
1011 Scenario : Test initial setup
@@ -898,6 +899,53 @@ Feature: APIv2
898899 | five | [{"id ": "admin ", "type ": 0 }] |
899900 Then the reported status is 403
900901
902+ @api2 @sharing @tables
903+ Scenario : Create a shared table and check its permissions
904+ Given table "Table 1 via api v2" with emoji "👋" exists for user "participant1-v2" as "t1" via v2
905+ And user "participant1-v2" shares table with user "participant2-v2"
906+ And user "participant1-v2" shares table with user "participant3-v2"
907+ Then user "participant3-v2" has the following permissions
908+ | read | 1 |
909+ | create | 1 |
910+ | update | 1 |
911+ | delete | 0 |
912+ | manage | 0 |
913+ # Current share-Id is set to the share towards participant3-v2!
914+ When user "participant3-v2" attempts to check the share permissions
915+ Then the reported status is 200
916+ When user "participant2-v2" attempts to check the share permissions
917+ Then the reported status is 404
918+ When user "participant4-v2" attempts to check the share permissions
919+ Then the reported status is 404
920+ # test against the share overview
921+ When user "participant1-v2" attempts to fetch all shares of table t1
922+ Then the reported status is 200
923+ When user "participant2-v2" attempts to fetch all shares of table t1
924+ Then the reported status is 403
925+ When user "participant4-v2" attempts to fetch all shares of table t1
926+ Then the reported status is 404
927+
928+ @api2 @sharing @views
929+ Scenario : Create a shared view and check its permissions
930+ Given table "Table 1 via api v2" with emoji "👋" exists for user "participant1-v2" as "t1" via v2
931+ And user "participant1-v2" create view "v1" with emoji "⚡️" for "t1" as "v1"
932+ And user "participant1-v2" shares view "v1" with "participant2-v2"
933+ And user "participant1-v2" shares view "v1" with "participant3-v2"
934+ # Current share-Id is set to the share towards participant3-v2!
935+ When user "participant2-v2" attempts to check the share permissions
936+ Then the reported status is 404
937+ When user "participant3-v2" attempts to check the share permissions
938+ Then the reported status is 200
939+ When user "participant4-v2" attempts to check the share permissions
940+ Then the reported status is 404
941+ # test against the share overview
942+ When user "participant1-v2" attempts to fetch all shares of view v1
943+ Then the reported status is 200
944+ When user "participant2-v2" attempts to fetch all shares of view v1
945+ Then the reported status is 403
946+ When user "participant4-v2" attempts to fetch all shares of view v1
947+ Then the reported status is 404
948+
901949 @api2 @rows @views
902950 Scenario : Create rows on a view via v2 without access
903951 Given table "Table 1 via api v2" with emoji "👋" exists for user "participant1-v2" as "t1" via v2
0 commit comments