@@ -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
@@ -888,6 +889,53 @@ Feature: APIv2
888889 | five | [{"id ": "admin ", "type ": 0 }] |
889890 Then the reported status is 403
890891
892+ @api2 @sharing @tables
893+ Scenario : Create a shared table and check its permissions
894+ Given table "Table 1 via api v2" with emoji "👋" exists for user "participant1-v2" as "t1" via v2
895+ And user "participant1-v2" shares table with user "participant2-v2"
896+ And user "participant1-v2" shares table with user "participant3-v2"
897+ Then user "participant3-v2" has the following permissions
898+ | read | 1 |
899+ | create | 1 |
900+ | update | 1 |
901+ | delete | 0 |
902+ | manage | 0 |
903+ # Current share-Id is set to the share towards participant3-v2!
904+ When user "participant3-v2" attempts to check the share permissions
905+ Then the reported status is 200
906+ When user "participant2-v2" attempts to check the share permissions
907+ Then the reported status is 404
908+ When user "participant4-v2" attempts to check the share permissions
909+ Then the reported status is 404
910+ # test against the share overview
911+ When user "participant1-v2" attempts to fetch all shares of table t1
912+ Then the reported status is 200
913+ When user "participant2-v2" attempts to fetch all shares of table t1
914+ Then the reported status is 403
915+ When user "participant4-v2" attempts to fetch all shares of table t1
916+ Then the reported status is 404
917+
918+ @api2 @sharing @views
919+ Scenario : Create a shared view and check its permissions
920+ Given table "Table 1 via api v2" with emoji "👋" exists for user "participant1-v2" as "t1" via v2
921+ And user "participant1-v2" create view "v1" with emoji "⚡️" for "t1" as "v1"
922+ And user "participant1-v2" shares view "v1" with "participant2-v2"
923+ And user "participant1-v2" shares view "v1" with "participant3-v2"
924+ # Current share-Id is set to the share towards participant3-v2!
925+ When user "participant2-v2" attempts to check the share permissions
926+ Then the reported status is 404
927+ When user "participant3-v2" attempts to check the share permissions
928+ Then the reported status is 200
929+ When user "participant4-v2" attempts to check the share permissions
930+ Then the reported status is 404
931+ # test against the share overview
932+ When user "participant1-v2" attempts to fetch all shares of view v1
933+ Then the reported status is 200
934+ When user "participant2-v2" attempts to fetch all shares of view v1
935+ Then the reported status is 403
936+ When user "participant4-v2" attempts to fetch all shares of view v1
937+ Then the reported status is 404
938+
891939 @api2 @rows @views
892940 Scenario : Create rows on a view via v2 without access
893941 Given table "Table 1 via api v2" with emoji "👋" exists for user "participant1-v2" as "t1" via v2
0 commit comments