2525use OCA \LogReader \Log \LogIteratorFactory ;
2626use OCA \LogReader \Log \SearchFilter ;
2727use OCA \LogReader \Service \SettingsService ;
28+ use OCA \LogReader \Settings \Admin ;
2829use OCP \AppFramework \Controller ;
2930use OCP \AppFramework \Http ;
31+ use OCP \AppFramework \Http \Attribute \AuthorizedAdminSetting ;
3032use OCP \AppFramework \Http \JSONResponse ;
3133use OCP \IRequest ;
3234use Psr \Log \LoggerInterface ;
@@ -48,12 +50,12 @@ public function __construct($appName,
4850 }
4951
5052 /**
51- * @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
5253 * @param string $query
5354 * @param int $count
5455 * @param int $offset
5556 * @return JSONResponse
5657 */
58+ #[AuthorizedAdminSetting(settings: Admin::class)]
5759 public function get ($ query = '' , $ count = 50 , $ offset = 0 ): JSONResponse {
5860 $ logType = $ this ->settingsService ->getLoggingType ();
5961 // we only support web access when `log_type` is set to `file` (the default)
@@ -86,7 +88,6 @@ private function getLastItem() {
8688 }
8789
8890 /**
89- * @AuthorizedAdminSetting(settings=OCA\LogReader\Settings\Admin)
9091 * @brief Use to poll for new log messages since $lastReqId.
9192 *
9293 * @note There is a possible race condition, when the user loads the
@@ -99,6 +100,7 @@ private function getLastItem() {
99100 * will work in some cases but not when there are more than 50 messages of that
100101 * request.
101102 */
103+ #[AuthorizedAdminSetting(settings: Admin::class)]
102104 public function poll (string $ lastReqId ): JSONResponse {
103105 $ logType = $ this ->settingsService ->getLoggingType ();
104106 // we only support web access when `log_type` is set to `file` (the default)
0 commit comments