MDL-63867 tool_dataprivacy: Add site purpose checks to tasks
If a site purpose is not defined, requests cannot be processed.
This commit is contained in:
@@ -74,6 +74,13 @@ class process_data_request_task extends adhoc_task {
|
||||
return;
|
||||
}
|
||||
|
||||
// If no site purpose is defined, reject requests since they cannot be processed.
|
||||
if (!\tool_dataprivacy\data_registry::defaults_set()) {
|
||||
api::update_request_status($requestid, api::DATAREQUEST_STATUS_REJECTED);
|
||||
mtrace('No site purpose defined. Request ' . $requestid . ' rejected.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the user details now. We might not be able to retrieve it later if it's a deletion processing.
|
||||
$foruser = core_user::get_user($request->userid);
|
||||
$usercontext = \context_user::instance($foruser->id);
|
||||
|
||||
Reference in New Issue
Block a user