Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@tool @tool_dataprivacy
2
Feature: Data delete from the privacy API
3
  In order to delete data for users and meet legal requirements
4
  As an admin, user, or parent
5
  I need to be able to request a user and their data data be deleted
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username       | firstname       | lastname |
10
      | victim         | Victim User     | 1        |
11
      | parent         | Long-suffering  | Parent   |
12
      | privacyofficer | Privacy Officer | One      |
13
    And the following "roles" exist:
14
      | shortname | name  | archetype |
15
      | tired     | Tired |           |
16
    And the following "permission overrides" exist:
17
      | capability                                           | permission | role    | contextlevel | reference |
18
      | tool/dataprivacy:makedatarequestsforchildren         | Allow      | tired   | System       |           |
19
      | tool/dataprivacy:makedatadeletionrequestsforchildren | Allow      | tired   | System       |           |
20
      | tool/dataprivacy:managedatarequests                  | Allow      | manager | System       |           |
21
    And the following "role assigns" exist:
22
      | user   | role  | contextlevel | reference |
23
      | parent | tired | User         | victim    |
24
    And the following "system role assigns" exist:
25
      | user           | role    | contextlevel |
26
      | privacyofficer | manager | User         |
27
    And the following config values are set as admin:
28
      | contactdataprotectionofficer | 1  | tool_dataprivacy |
29
    And the following data privacy "categories" exist:
30
      | name          |
31
      | Site category |
32
    And the following data privacy "purposes" exist:
33
      | name         | retentionperiod |
34
      | Site purpose | P10Y           |
35
    And the following config values are set as admin:
36
      | contactdataprotectionofficer | 1  | tool_dataprivacy |
37
      | privacyrequestexpiry         | 55 | tool_dataprivacy |
38
      | dporoles                     | 1  | tool_dataprivacy |
39
    And I set the site category and purpose to "Site category" and "Site purpose"
40
 
41
  @javascript
42
  Scenario: As admin, delete a user and their data
43
    Given I log in as "victim"
44
    And I should see "Victim User 1"
45
    And I log out
46
 
47
    And I log in as "admin"
48
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
49
    And I follow "New request"
50
    And I set the field "User" to "Victim User 1"
51
    And I set the field "Type" to "Delete all of my personal data"
52
    And I press "Save changes"
53
    Then I should see "Victim User 1"
54
    And I should see "Awaiting approval" in the "Victim User 1" "table_row"
55
    And I open the action menu in "Victim User 1" "table_row"
56
    And I follow "Approve request"
1441 ariadna 57
    And I wait until "Approve request" "button" exists
1 efrain 58
    And I press "Approve request"
59
    And I should see "Approved" in the "Victim User 1" "table_row"
60
    And I run all adhoc tasks
61
    And I reload the page
62
    And I should see "Deleted" in the "Victim User 1" "table_row"
63
 
64
    And I log out
65
    And I log in as "victim"
66
    And I should see "Invalid login"
67
 
68
  @javascript
69
  Scenario: As a student, request deletion of account and data
70
    Given I log in as "victim"
71
    And I follow "Profile" in the user menu
72
    And I follow "Data requests"
73
    And I follow "New request"
74
    And I set the field "Type" to "Delete all of my personal data"
75
    And I press "Save changes"
76
    Then I should see "Delete all of my personal data"
77
    And I should see "Awaiting approval" in the "Delete all of my personal data" "table_row"
78
 
79
    And I log out
80
    And I log in as "admin"
81
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
82
    And I open the action menu in "Victim User 1" "table_row"
83
    And I follow "Approve request"
1441 ariadna 84
    And I wait until "Approve request" "button" exists
1 efrain 85
    And I press "Approve request"
86
 
87
    And I log out
88
    And I log in as "victim"
89
    And I follow "Profile" in the user menu
90
    And I follow "Data requests"
91
    And I should see "Approved" in the "Delete all of my personal data" "table_row"
92
    And I run all adhoc tasks
93
    And I reload the page
94
    And I should see "Your session has timed out"
95
    And I log in as "victim"
96
    And I should see "Invalid login"
97
 
98
    And I log in as "admin"
99
    And I am on site homepage
100
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
101
    And I should see "Deleted"
102
 
103
  @javascript
104
  Scenario: As a parent, request account and data deletion for my child
105
    Given I log in as "parent"
106
    And I follow "Profile" in the user menu
107
    And I follow "Data requests"
108
    And I follow "New request"
109
    And I set the field "User" to "Victim User 1"
110
    And I set the field "Type" to "Delete all of my personal data"
111
    And I press "Save changes"
112
    Then I should see "Victim User 1"
113
    And I should see "Awaiting approval" in the "Victim User 1" "table_row"
114
 
115
    And I log out
116
    And I log in as "admin"
117
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
118
    And I open the action menu in "Victim User 1" "table_row"
119
    And I follow "Approve request"
1441 ariadna 120
    And I wait until "Approve request" "button" exists
1 efrain 121
    And I press "Approve request"
122
 
123
    And I log out
124
    And I log in as "parent"
125
    And I follow "Profile" in the user menu
126
    And I follow "Data requests"
127
    And I should see "Approved" in the "Victim User 1" "table_row"
128
    And I run all adhoc tasks
129
    And I reload the page
130
    And I should see "You don't have any personal data requests"
131
 
132
  @javascript
133
  Scenario: As a Privacy Officer, I cannot create data deletion request unless I have permission.
134
    Given I log in as "privacyofficer"
135
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
136
    And I follow "New request"
137
    And I open the autocomplete suggestions list
138
    And I click on "Victim User 1" item in the autocomplete list
139
    Then I should see "Export all of my personal data"
140
    And "Type" "select" should not be visible
141
    And the following "permission overrides" exist:
142
      | capability                                 | permission | role    | contextlevel | reference |
143
      | tool/dataprivacy:requestdeleteforotheruser | Allow      | manager | System       |           |
144
    And I reload the page
145
    And I open the autocomplete suggestions list
146
    And I click on "Victim User 1" item in the autocomplete list
147
    And "Type" "select" should be visible
148
 
149
  @javascript
150
  Scenario: As a student, I cannot create data deletion request unless I have permission.
151
    Given I log in as "victim"
152
    And I follow "Profile" in the user menu
153
    And I follow "Data requests"
154
    And I follow "New request"
155
    Then "Type" "select" should exist
156
    And the following "permission overrides" exist:
157
      | capability                     | permission | role | contextlevel | reference |
158
      | tool/dataprivacy:requestdelete | Prevent    | user | System       |           |
159
    And I reload the page
160
    And I should see "Export all of my personal data"
161
    And "Type" "select" should not exist
162
 
163
  @javascript
164
  Scenario: As a parent, I cannot create data deletion request unless I have permission.
165
    Given I log in as "parent"
166
    And the following "permission overrides" exist:
167
      | capability                                           | permission | role  | contextlevel | reference |
168
      | tool/dataprivacy:makedatadeletionrequestsforchildren | Prevent    | tired | System       | victim    |
169
    And I follow "Profile" in the user menu
170
    And I follow "Data requests"
171
    And I follow "New request"
172
    And I open the autocomplete suggestions list
173
    And I click on "Victim User 1" item in the autocomplete list
174
    And I set the field "Type" to "Delete all of my personal data"
175
    And I press "Save changes"
176
    And I should see "You don't have permission to create deletion request for this user."
177
    And the following "permission overrides" exist:
178
      | capability                                           | permission | role  | contextlevel | reference |
179
      | tool/dataprivacy:makedatadeletionrequestsforchildren | Allow      | tired | System       | victim    |
180
      | tool/dataprivacy:requestdelete                       | Prevent    | user  | System       |           |
181
    And I open the autocomplete suggestions list
182
    And I click on "Long-suffering Parent" item in the autocomplete list
183
    And I press "Save changes"
184
    And I should see "You don't have permission to create deletion request for yourself."
185
 
186
  @javascript
187
  Scenario: As a student, link to create data deletion should not be shown if I don't have permission.
188
    Given the following "permission overrides" exist:
189
      | capability                     | permission | role | contextlevel | reference |
190
      | tool/dataprivacy:requestdelete | Prohibit   | user | System       |           |
191
    When I log in as "victim"
192
    And I follow "Profile" in the user menu
193
    Then I should not see "Delete my account"
194
 
195
  @javascript
196
  Scenario: As a primary admin, the link to create a data deletion request should not be shown.
197
    Given I log in as "admin"
198
    When I follow "Profile" in the user menu
199
    Then I should not see "Delete my account"
200
 
201
  @javascript
202
  Scenario: As a Privacy Officer, I cannot Approve to Deny deletion data request without permission.
203
    Given the following "permission overrides" exist:
204
      | capability                                 | permission | role    | contextlevel | reference |
205
      | tool/dataprivacy:requestdeleteforotheruser | Allow      | manager | System       |           |
206
    When I log in as "privacyofficer"
207
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
208
    And I follow "New request"
209
    And I open the autocomplete suggestions list
210
    And I click on "Victim User 1" item in the autocomplete list
211
    And I set the field "Type" to "Delete all of my personal data"
212
    And I press "Save changes"
213
    And the following "permission overrides" exist:
214
      | capability                                 | permission | role    | contextlevel | reference |
215
      | tool/dataprivacy:requestdeleteforotheruser | Prohibit   | manager | System       |           |
216
    And I reload the page
217
    Then ".selectrequests" "css_element" should not exist
218
    And I open the action menu in "region-main" "region"
219
    And I should not see "Approve request"
220
    And I should not see "Deny request"
221
    And I choose "View the request" in the open action menu
222
    And "Approve" "button" should not exist
223
    And "Deny" "button" should not exist
224
 
225
  @javascript
226
  Scenario: As a Privacy Officer, I cannot re-submit deletion data request without permission.
227
    Given the following "permission overrides" exist:
228
      | capability                                 | permission | role    | contextlevel | reference |
229
      | tool/dataprivacy:requestdeleteforotheruser | Allow      | manager | System       |           |
230
    When I log in as "privacyofficer"
231
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
232
    And I follow "New request"
233
    And I open the autocomplete suggestions list
234
    And I click on "Victim User 1" item in the autocomplete list
235
    And I set the field "Type" to "Delete all of my personal data"
236
    And I press "Save changes"
237
    And I open the action menu in "region-main" "region"
238
    And I follow "Deny request"
239
    And I press "Deny request"
240
    And the following "permission overrides" exist:
241
      | capability                                 | permission | role    | contextlevel | reference |
242
      | tool/dataprivacy:requestdeleteforotheruser | Prohibit   | manager | System       |           |
243
    And I reload the page
244
    And I open the action menu in "region-main" "region"
245
    Then I should not see "Resubmit as new request"
246
 
247
  Scenario: Request data deletion as student with automatic approval turned on
248
    Given the following config values are set as admin:
249
      | automaticdatadeletionapproval | 1  | tool_dataprivacy |
250
    And I log in as "victim"
251
    And I follow "Profile" in the user menu
252
    And I follow "Delete my account"
253
    When I press "Save changes"
254
    Then I should see "Your request has been submitted and will be processed soon."
255
    And I should see "Approved" in the "Delete all of my personal data" "table_row"
256
 
257
  @javascript
258
  Scenario: Delete flow stay the same even allow filtering of exports by course setting is enabled.
259
    Given the following config values are set as admin:
260
      | allowfiltering | 1 | tool_dataprivacy |
261
    And I log in as "victim"
262
    And I should see "Victim User 1"
263
    And I log out
264
 
265
    And I log in as "admin"
266
    And I navigate to "Users > Privacy and policies > Data requests" in site administration
267
    And I follow "New request"
268
    And I set the field "User" to "Victim User 1"
269
    And I set the field "Type" to "Delete all of my personal data"
270
    And I press "Save changes"
271
    Then I should see "Victim User 1"
272
    And I should see "Awaiting approval" in the "Victim User 1" "table_row"
273
    And I open the action menu in "Victim User 1" "table_row"
274
    And I follow "Approve request"
275
    And I press "Approve request"
276
    And I should see "Approved" in the "Victim User 1" "table_row"
277
    And I run all adhoc tasks
278
    And I reload the page
279
    And I should see "Deleted" in the "Victim User 1" "table_row"
280
 
281
    And I log out
282
    And I log in as "victim"
283
    And I should see "Invalid login"