From c68aefb847b09daa0697de7684d3451e2e68ce1e Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 09 Jul 2026 23:10:23 +0000
Subject: [PATCH] =Refactor of Integrations.php to be a bit more useful with a suite of methods for create, update, delete back and forths for integrations where sharing is enabled. Also considering a single instance with a connect method to connect as the site (no user) vs connecting as an individual user - rather than recreating instances for every user.

---
 inc/rest/routes/OptionsRoutes.php |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/inc/rest/routes/OptionsRoutes.php b/inc/rest/routes/OptionsRoutes.php
index de1f75a..0ba6861 100644
--- a/inc/rest/routes/OptionsRoutes.php
+++ b/inc/rest/routes/OptionsRoutes.php
@@ -32,7 +32,6 @@
 			->auth(PermissionHandler::combine(['user', ['actionNonce' => 'dash-']]))
 			->rateLimit(3)
 			->args([
-				'user'	=> 'int|required',
 				'id'	=> 'string|required',
 			])
 			->register();
@@ -41,11 +40,11 @@
 	public function saveOptions(WP_REST_Request $request):WP_REST_Response
 	{
 		$data = $request->get_params();
-		$user = $data['user'];
-		if ($user && !user_can($user, 'manage_options')) {
+		$user = get_current_user_id();
+		if ($user && !current_user_can( 'manage_options')) {
 			return $this->error('User Cannot modify options');
 		}
-		unset($data['user']);
+
 		$operationID = $data['id'];
 		unset($data['id']);
 

--
Gitblit v1.10.0