1919use OCP \Activity \IFilter ;
2020use OCP \Activity \IManager ;
2121use OCP \AppFramework \Http ;
22+ use OCP \AppFramework \Http \Attribute \NoAdminRequired ;
2223use OCP \AppFramework \Http \DataResponse ;
2324use OCP \AppFramework \OCSController ;
2425use OCP \Files \FileInfo ;
@@ -94,36 +95,33 @@ protected function validateParameters(string $filter, int $since, int $limit, bo
9495 }
9596
9697 /**
97- * @NoAdminRequired
98- *
9998 * @param string $search Only return activities whose file path contains this substring
10099 * @param int $from Only return activities at or after this Unix timestamp
101100 * @param int $to Only return activities at or before this Unix timestamp
102101 * @param string $actor Only return activities authored by this account
103102 */
103+ #[NoAdminRequired]
104104 public function getDefault (int $ since = 0 , int $ limit = 50 , bool $ previews = false , string $ object_type = '' , int $ object_id = 0 , string $ sort = 'desc ' , string $ search = '' , int $ from = 0 , int $ to = 0 , string $ actor = '' ): DataResponse {
105105 return $ this ->get ('all ' , $ since , $ limit , $ previews , $ object_type , $ object_id , $ sort , $ search , $ from , $ to , $ actor );
106106 }
107107
108108 /**
109- * @NoAdminRequired
110- *
111109 * @param string $search Only return activities whose file path contains this substring
112110 * @param int $from Only return activities at or after this Unix timestamp
113111 * @param int $to Only return activities at or before this Unix timestamp
114112 * @param string $actor Only return activities authored by this account
115113 */
114+ #[NoAdminRequired]
116115 public function getFilter (string $ filter , int $ since = 0 , int $ limit = 50 , bool $ previews = false , string $ object_type = '' , int $ object_id = 0 , string $ sort = 'desc ' , string $ search = '' , int $ from = 0 , int $ to = 0 , string $ actor = '' ): DataResponse {
117116 return $ this ->get ($ filter , $ since , $ limit , $ previews , $ object_type , $ object_id , $ sort , $ search , $ from , $ to , $ actor );
118117 }
119118
120119 /**
121- * @NoAdminRequired
122- *
123120 * @param string $object_type Object type to count downloads for (must be 'files')
124121 * @param int $object_id File ID
125122 * @return DataResponse
126123 */
124+ #[NoAdminRequired]
127125 public function getDownloadCount (string $ object_type = 'files ' , int $ object_id = 0 ): DataResponse {
128126 $ user = $ this ->userSession ->getUser ();
129127 if (!$ user instanceof IUser) {
@@ -141,10 +139,9 @@ public function getDownloadCount(string $object_type = 'files', int $object_id =
141139 }
142140
143141 /**
144- * @NoAdminRequired
145- *
146- * @return DataResponse
142+ * @return DataResponse<Http::STATUS_OK, list<array{id: string, name: string, icon: string, priority: int}>, array{}>
147143 */
144+ #[NoAdminRequired]
148145 public function listFilters (): DataResponse {
149146 $ filters = $ this ->activityManager ->getFilters ();
150147
0 commit comments