99use OCA \LogReader \Log \LogIteratorFactory ;
1010use OCA \LogReader \Log \SearchFilter ;
1111use OCA \LogReader \Service \SettingsService ;
12+ use OCA \LogReader \Settings \Admin ;
1213use OCP \AppFramework \Controller ;
1314use OCP \AppFramework \Http ;
15+ use OCP \AppFramework \Http \Attribute \AuthorizedAdminSetting ;
1416use OCP \AppFramework \Http \JSONResponse ;
1517use OCP \IRequest ;
1618use Psr \Log \LoggerInterface ;
@@ -32,12 +34,12 @@ public function __construct($appName,
3234 }
3335
3436 /**
35- * @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
3637 * @param string $query
3738 * @param int $count
3839 * @param int $offset
3940 * @return JSONResponse
4041 */
42+ #[AuthorizedAdminSetting(settings: Admin::class)]
4143 public function get ($ query = '' , $ count = 50 , $ offset = 0 ): JSONResponse {
4244 $ logType = $ this ->settingsService ->getLoggingType ();
4345 // we only support web access when `log_type` is set to `file` (the default)
@@ -70,7 +72,6 @@ private function getLastItem() {
7072 }
7173
7274 /**
73- * @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
7475 * @brief Use to poll for new log messages since $lastReqId.
7576 *
7677 * @note There is a possible race condition, when the user loads the
@@ -83,6 +84,7 @@ private function getLastItem() {
8384 * will work in some cases but not when there are more than 50 messages of that
8485 * request.
8586 */
87+ #[AuthorizedAdminSetting(settings: Admin::class)]
8688 public function poll (string $ lastReqId ): JSONResponse {
8789 $ logType = $ this ->settingsService ->getLoggingType ();
8890 // we only support web access when `log_type` is set to `file` (the default)
0 commit comments