request_method === 'POST') { $API_office_stompjes->checkPermissions('ofice-stompjes-canstomp', 'RW'); $API_office_stompjes->return_url = false; $requiredFields = [ 'user_uuid' => ['type' => 'uuid'] ]; $API_office_stompjes->validateData($requiredFields); $modules = $API_office_stompjes->addStomp(); $API_office_stompjes->apiOutput($code = 200, ['success' => 'stomp added successfully.']); } elseif ($API_office_stompjes->request_method === 'DELETE') { # Only superuser can delete permission due to fact that the backend needs programming when setting a permission $API_office_stompjes->checkPermissions('ofice-stompjes', 'RW'); # when called from the frontend will not be forwarding to a url since when its called from the frontend it doesnt need a redirection $API_office_stompjes->return_url = false; $requiredFields = ['stomp_uuid' => ['type' => 'uuid']]; $API_office_stompjes->validateData($requiredFields); # delete permission $API_office_stompjes->deleteStomp(); }