X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/1c43602f4bed60a84f47735ca8bc4a399018e013..refs/pull/3918/head:/app/Settings/SettingService.php diff --git a/app/Settings/SettingService.php b/app/Settings/SettingService.php index f2c4c8305..9f0a41ea2 100644 --- a/app/Settings/SettingService.php +++ b/app/Settings/SettingService.php @@ -194,6 +194,8 @@ class SettingService /** * Put a user-specific setting into the database. + * Can only take string value types since this may use + * the session which is less flexible to data types. */ public function putUser(User $user, string $key, string $value): bool { @@ -206,6 +208,16 @@ class SettingService return $this->put($this->userKey($user->id, $key), $value); } + /** + * Put a user-specific setting into the database for the current access user. + * Can only take string value types since this may use + * the session which is less flexible to data types. + */ + public function putForCurrentUser(string $key, string $value) + { + return $this->putUser(user(), $key, $value); + } + /** * Convert a setting key into a user-specific key. */