-
Notifications
You must be signed in to change notification settings - Fork 187
/
setQuota.feature
168 lines (155 loc) · 5.48 KB
/
setQuota.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
Feature: Set quota
As a user
I want to set quota to different users
So that users can only take up a certain amount of storage space
Background:
Given these users have been created with default attributes:
| username |
| Alice |
| Brian |
Scenario Outline: admin sets personal space quota of user with different role
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
And the administrator has assigned the role "<user-role>" to user "Brian" using the Graph 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 the JSON data of the response should match
"""
{
"type": "object",
"required": [
"quota"
],
"properties": {
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"total" : {
"type": "number",
"enum": [100]
}
}
}
}
}
"""
Examples:
| user-role |
| Admin |
| Space Admin |
| User |
| User Light |
Scenario Outline: non-admin user tries to set the personal space quota of other users
Given the administrator has assigned the role "<user-role-2>" to user "Alice" using the Graph API
And the administrator has assigned the role "<user-role>" to user "Brian" using the Graph 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 "403"
Examples:
| user-role-2 | user-role |
| Space Admin | Admin |
| Space Admin | Space Admin |
| Space Admin | User |
| Space Admin | User Light |
| User | Admin |
| User | Space Admin |
| User | User |
| User | User Light |
| User Light | Admin |
| User Light | Space Admin |
| User Light | User |
| User Light | User Light |
Scenario Outline: admin or space admin user sets a quota of a project space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And the administrator has assigned the role "<user-role>" to user "Brian" using the Graph API
And user "Alice" has created a space "Project Jupiter" of type "project" with quota "20"
When user "Brian" changes the quota of the "Project Jupiter" space to "100" owned by user "Alice"
Then the HTTP status code should be "200"
And the JSON data of the response should 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:
| user-role |
| Admin |
| Space Admin |
Scenario Outline: normal or user light user tries to set quota of a space
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And the administrator has assigned the role "<user-role>" to user "Brian" using the Graph API
And user "Alice" has created a space "Project Jupiter" of type "project" with quota "20"
And user "Alice" has sent the following space share invitation:
| space | Project Jupiter |
| sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
When user "Brian" changes the quota of the "Project Jupiter" space to "100"
Then the HTTP status code should be "403"
Examples:
| user-role | space-role |
| User | Space Viewer |
| User | Space Editor |
| User | Manager |
| User Light | Space Viewer |
| User Light | Space Editor |
| User Light | Manager |
Scenario: admin user can set their own personal space quota
Given the administrator has assigned the role "Admin" to user "Alice" using the Graph API
When user "Alice" changes the quota of the "Alice Hansen" space to "100" owned by user "Alice"
Then the HTTP status code should be "200"
And the JSON data of the response should match
"""
{
"type": "object",
"required": [
"quota"
],
"properties": {
"quota": {
"type": "object",
"required": [
"total"
],
"properties": {
"total" : {
"type": "number",
"enum": [100]
}
}
}
}
}
"""
Scenario Outline: non-admin user tries to set their own personal space quota
Given the administrator has assigned the role "<user-role>" to user "Alice" using the Graph API
When user "Alice" changes the quota of the "Alice Hansen" space to "100" owned by user "Alice"
Then the HTTP status code should be "403"
Examples:
| user-role |
| Space Admin |
| User |
| User Light |