diff --git a/tests/acceptance/features/apiSpaces/setQuota.feature b/tests/acceptance/features/apiSpaces/setQuota.feature new file mode 100644 index 00000000000..d087554fac9 --- /dev/null +++ b/tests/acceptance/features/apiSpaces/setQuota.feature @@ -0,0 +1,183 @@ +@api @skipOnOcV10 +Feature: Set quota + As a user + I want to set quota to different users + + Background: + Given these users have been created with default attributes and without skeleton files: + | username | + | Alice | + | Brian | + + Scenario Outline: admin or space admin sets personal space quota of user with different role + Given the administrator has given "Alice" the role "" using the settings api + And the administrator has given "Brian" the role "" using the settings api + When user "Alice" changes the quota of the "Brian Murphy" space to "100" owned by user "Brian" + Then the HTTP status code should be "200" + And for user "Brian" the JSON response should contain space called "Brian Murphy" and match + """ + { + "type": "object", + "required": [ + "quota" + ], + "properties": { + "quota": { + "type": "object", + "required": [ + "total" + ], + "properties": { + "total" : { + "type": "number", + "enum": [100] + } + } + } + } + } + """ + Examples: + | role | userRole | + | Admin | Admin | + | Admin | Space Admin | + | Admin | User | + | Admin | Guest | + | Space Admin | Admin | + | Space Admin | Space Admin | + | Space Admin | User | + | Space Admin | Guest | + + + Scenario Outline: non-admin user tries to set personal space quota of user with different role + Given the administrator has given "Alice" the role "" using the settings api + And the administrator has given "Brian" the role "" using the settings api + When user "Alice" changes the quota of the "Brian Murphy" space to "100" owned by user "Brian" + Then the HTTP status code should be "401" + And for user "Brian" the JSON response should contain space called "Brian Murphy" and match + """ + { + "type": "object", + "required": [ + "quota" + ], + "properties": { + "quota": { + "type": "object", + "required": [ + "total" + ], + "properties": { + "total" : { + "type": "number", + "enum": [0] + } + } + } + } + } + """ + Examples: + | role | userRole | + | User | Space Admin | + | User | User | + | User | Guest | + | User | Admin | + | Guest | Space Admin | + | Guest | User | + | Guest | Guest | + | Guest | Admin | + + + Scenario Outline: admin or space admin user with different space role set quota of a space + Given the administrator has given "Alice" the role "Space Admin" using the settings api + And the administrator has given "Brian" the role "" using the settings api + And user "Alice" has created a space "Project Jupiter" of type "project" with quota "20" + And user "Alice" has shared a space "Project Jupiter" with settings: + | shareWith | Brian | + | role | | + When user "Brian" changes the quota of the "Project Jupiter" space to "100" + Then the HTTP status code should be "200" + And for user "Alice" the JSON response should contain space called "Project Jupiter" and match + """ + { + "type": "object", + "required": [ + "name", + "quota" + ], + "properties": { + "name": { + "type": "string", + "enum": ["Project Jupiter"] + }, + "quota": { + "type": "object", + "required": [ + "total" + ], + "properties": { + "total" : { + "type": "number", + "enum": [100] + } + } + } + } + } + """ + Examples: + | userRole | spaceRole | + | Admin | viewer | + | Admin | editor | + | Admin | manager | + | Space Admin | viewer | + | Space Admin | editor | + | Space Admin | manager | + + + Scenario Outline: non-admin user with different space role tries to set quota of a space + Given the administrator has given "Alice" the role "Space Admin" using the settings api + And the administrator has given "Brian" the role "" using the settings api + And user "Alice" has created a space "Project Jupiter" of type "project" with quota "20" + And user "Alice" has shared a space "Project Jupiter" with settings: + | shareWith | Brian | + | role | | + When user "Brian" changes the quota of the "Project Jupiter" space to "100" + Then the HTTP status code should be "401" + And for user "Alice" the JSON response should contain space called "Project Jupiter" and match + """ + { + "type": "object", + "required": [ + "name", + "quota" + ], + "properties": { + "name": { + "type": "string", + "enum": ["Project Jupiter"] + }, + "quota": { + "type": "object", + "required": [ + "total" + ], + "properties": { + "total" : { + "type": "number", + "enum": [20] + } + } + } + } + } + """ + Examples: + | userRole | spaceRole | + | User | viewer | + | User | editor | + | User | manager | + | Guest | viewer | + | Guest | editor | + | Guest | manager |