14
14
use OCA \GroupFolders \Service \DelegationService ;
15
15
use OCA \GroupFolders \Service \FoldersFilter ;
16
16
use OCP \AppFramework \Http ;
17
- use OCP \AppFramework \Http \Attribute \ApiRoute ;
17
+ use OCP \AppFramework \Http \Attribute \FrontpageRoute ;
18
18
use OCP \AppFramework \Http \Attribute \NoAdminRequired ;
19
19
use OCP \AppFramework \Http \Attribute \PasswordConfirmationRequired ;
20
20
use OCP \AppFramework \Http \DataResponse ;
@@ -77,7 +77,7 @@ private function formatFolder(array $folder): array {
77
77
}
78
78
79
79
#[NoAdminRequired]
80
- #[ApiRoute (verb: 'GET ' , url: '/folders ' )]
80
+ #[FrontpageRoute (verb: 'GET ' , url: '/folders ' )]
81
81
public function getFolders (bool $ applicable = false ): DataResponse {
82
82
$ storageId = $ this ->getRootFolderStorageId ();
83
83
if ($ storageId === null ) {
@@ -104,7 +104,7 @@ public function getFolders(bool $applicable = false): DataResponse {
104
104
}
105
105
106
106
#[NoAdminRequired]
107
- #[ApiRoute (verb: 'GET ' , url: '/folders/{id} ' )]
107
+ #[FrontpageRoute (verb: 'GET ' , url: '/folders/{id} ' )]
108
108
public function getFolder (int $ id ): DataResponse {
109
109
$ response = $ this ->checkFolderExists ($ id );
110
110
if ($ response ) {
@@ -155,7 +155,7 @@ private function getRootFolderStorageId(): ?int {
155
155
#[PasswordConfirmationRequired]
156
156
#[RequireGroupFolderAdmin]
157
157
#[NoAdminRequired]
158
- #[ApiRoute (verb: 'POST ' , url: '/folders ' )]
158
+ #[FrontpageRoute (verb: 'POST ' , url: '/folders ' )]
159
159
public function addFolder (string $ mountpoint ): DataResponse {
160
160
161
161
$ storageId = $ this ->rootFolder ->getMountPoint ()->getNumericStorageId ();
@@ -175,7 +175,7 @@ public function addFolder(string $mountpoint): DataResponse {
175
175
#[PasswordConfirmationRequired]
176
176
#[RequireGroupFolderAdmin]
177
177
#[NoAdminRequired]
178
- #[ApiRoute (verb: 'DELETE ' , url: '/folders/{id} ' )]
178
+ #[FrontpageRoute (verb: 'DELETE ' , url: '/folders/{id} ' )]
179
179
public function removeFolder (int $ id ): DataResponse {
180
180
$ response = $ this ->checkFolderExists ($ id );
181
181
if ($ response ) {
@@ -196,7 +196,7 @@ public function removeFolder(int $id): DataResponse {
196
196
#[PasswordConfirmationRequired]
197
197
#[RequireGroupFolderAdmin]
198
198
#[NoAdminRequired]
199
- #[ApiRoute (verb: 'PUT ' , url: '/folders/{id} ' )]
199
+ #[FrontpageRoute (verb: 'PUT ' , url: '/folders/{id} ' )]
200
200
public function setMountPoint (int $ id , string $ mountPoint ): DataResponse {
201
201
$ this ->manager ->renameFolder ($ id , trim ($ mountPoint ));
202
202
return new DataResponse (['success ' => true ]);
@@ -205,7 +205,7 @@ public function setMountPoint(int $id, string $mountPoint): DataResponse {
205
205
#[PasswordConfirmationRequired]
206
206
#[RequireGroupFolderAdmin]
207
207
#[NoAdminRequired]
208
- #[ApiRoute (verb: 'POST ' , url: '/folders/{id}/groups ' )]
208
+ #[FrontpageRoute (verb: 'POST ' , url: '/folders/{id}/groups ' )]
209
209
public function addGroup (int $ id , string $ group ): DataResponse {
210
210
$ response = $ this ->checkFolderExists ($ id );
211
211
if ($ response ) {
@@ -220,7 +220,7 @@ public function addGroup(int $id, string $group): DataResponse {
220
220
#[PasswordConfirmationRequired]
221
221
#[RequireGroupFolderAdmin]
222
222
#[NoAdminRequired]
223
- #[ApiRoute (verb: 'DELETE ' , url: '/folders/{id}/groups/{group} ' , requirements: ['group ' => '.+ ' ])]
223
+ #[FrontpageRoute (verb: 'DELETE ' , url: '/folders/{id}/groups/{group} ' , requirements: ['group ' => '.+ ' ])]
224
224
public function removeGroup (int $ id , string $ group ): DataResponse {
225
225
$ response = $ this ->checkFolderExists ($ id );
226
226
if ($ response ) {
@@ -235,7 +235,7 @@ public function removeGroup(int $id, string $group): DataResponse {
235
235
#[PasswordConfirmationRequired]
236
236
#[RequireGroupFolderAdmin]
237
237
#[NoAdminRequired]
238
- #[ApiRoute (verb: 'POST ' , url: '/folders/{id}/groups/{group} ' , requirements: ['group ' => '.+ ' ])]
238
+ #[FrontpageRoute (verb: 'POST ' , url: '/folders/{id}/groups/{group} ' , requirements: ['group ' => '.+ ' ])]
239
239
public function setPermissions (int $ id , string $ group , int $ permissions ): DataResponse {
240
240
$ response = $ this ->checkFolderExists ($ id );
241
241
if ($ response ) {
@@ -253,7 +253,7 @@ public function setPermissions(int $id, string $group, int $permissions): DataRe
253
253
#[PasswordConfirmationRequired]
254
254
#[RequireGroupFolderAdmin]
255
255
#[NoAdminRequired]
256
- #[ApiRoute (verb: 'POST ' , url: '/folders/{id}/manageACL ' )]
256
+ #[FrontpageRoute (verb: 'POST ' , url: '/folders/{id}/manageACL ' )]
257
257
public function setManageACL (int $ id , string $ mappingType , string $ mappingId , bool $ manageAcl ): DataResponse {
258
258
$ response = $ this ->checkFolderExists ($ id );
259
259
if ($ response ) {
@@ -268,7 +268,7 @@ public function setManageACL(int $id, string $mappingType, string $mappingId, bo
268
268
#[PasswordConfirmationRequired]
269
269
#[RequireGroupFolderAdmin]
270
270
#[NoAdminRequired]
271
- #[ApiRoute (verb: 'POST ' , url: '/folders/{id}/quota ' )]
271
+ #[FrontpageRoute (verb: 'POST ' , url: '/folders/{id}/quota ' )]
272
272
public function setQuota (int $ id , int $ quota ): DataResponse {
273
273
$ response = $ this ->checkFolderExists ($ id );
274
274
if ($ response ) {
@@ -283,7 +283,7 @@ public function setQuota(int $id, int $quota): DataResponse {
283
283
#[PasswordConfirmationRequired]
284
284
#[RequireGroupFolderAdmin]
285
285
#[NoAdminRequired]
286
- #[ApiRoute (verb: 'POST ' , url: '/folders/{id}/acl ' )]
286
+ #[FrontpageRoute (verb: 'POST ' , url: '/folders/{id}/acl ' )]
287
287
public function setACL (int $ id , bool $ acl ): DataResponse {
288
288
$ response = $ this ->checkFolderExists ($ id );
289
289
if ($ response ) {
@@ -298,7 +298,7 @@ public function setACL(int $id, bool $acl): DataResponse {
298
298
#[PasswordConfirmationRequired]
299
299
#[RequireGroupFolderAdmin]
300
300
#[NoAdminRequired]
301
- #[ApiRoute (verb: 'POST ' , url: '/folders/{id}/mountpoint ' )]
301
+ #[FrontpageRoute (verb: 'POST ' , url: '/folders/{id}/mountpoint ' )]
302
302
public function renameFolder (int $ id , string $ mountpoint ): DataResponse {
303
303
$ response = $ this ->checkFolderExists ($ id );
304
304
if ($ response ) {
@@ -346,7 +346,7 @@ private function folderDataForXML(array $data): array {
346
346
}
347
347
348
348
#[NoAdminRequired]
349
- #[ApiRoute (verb: 'GET ' , url: '/folders/{id}/search ' )]
349
+ #[FrontpageRoute (verb: 'GET ' , url: '/folders/{id}/search ' )]
350
350
public function aclMappingSearch (int $ id , ?int $ fileId , string $ search = '' ): DataResponse {
351
351
$ users = [];
352
352
$ groups = [];
0 commit comments