File tree Expand file tree Collapse file tree 4 files changed +88
-0
lines changed Expand file tree Collapse file tree 4 files changed +88
-0
lines changed Original file line number Diff line number Diff line change 466
466
if ($ scopes === []) {
467
467
if ($ controllerScopes !== []) {
468
468
$ scopes = $ controllerScopes ;
469
+ } elseif (!$ isOCS ) {
470
+ $ scopes = ['ignore ' ];
469
471
} elseif ($ isExApp ) {
470
472
$ scopes = ['ex_app ' ];
471
473
} elseif ($ isAdmin ) {
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ /**
6
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
7
+ * SPDX-License-Identifier: AGPL-3.0-or-later
8
+ */
9
+
10
+ namespace OCA \Notifications \Controller ;
11
+
12
+ use OCP \AppFramework \Controller ;
13
+ use OCP \AppFramework \Http ;
14
+ use OCP \AppFramework \Http \Attribute \FrontpageRoute ;
15
+ use OCP \AppFramework \Http \Attribute \NoCSRFRequired ;
16
+ use OCP \AppFramework \Http \Attribute \OpenAPI ;
17
+ use OCP \AppFramework \Http \Response ;
18
+
19
+ class PlainController extends Controller {
20
+ #[NoCSRFRequired]
21
+ #[FrontpageRoute(verb: 'GET ' , url: '/plain/ignored ' )]
22
+ public function ignored (): Response {
23
+ return new Response ();
24
+ }
25
+
26
+
27
+ /**
28
+ * Route with manual scope to not get ignored
29
+ *
30
+ * @return Response<Http::STATUS_OK, array{}>
31
+ *
32
+ * 200: Response returned
33
+ */
34
+ #[NoCSRFRequired]
35
+ #[OpenAPI(scope: OpenAPI::SCOPE_DEFAULT )]
36
+ #[FrontpageRoute(verb: 'GET ' , url: '/plain/with-scope ' )]
37
+ public function withScope (): Response {
38
+ return new Response ();
39
+ }
40
+ }
Original file line number Diff line number Diff line change 5485
5485
}
5486
5486
}
5487
5487
},
5488
+ "/index.php/apps/notifications/plain/with-scope" : {
5489
+ "get" : {
5490
+ "operationId" : " plain-with-scope" ,
5491
+ "summary" : " Route with manual scope to not get ignored" ,
5492
+ "description" : " This endpoint requires admin access" ,
5493
+ "tags" : [
5494
+ " plain"
5495
+ ],
5496
+ "security" : [
5497
+ {
5498
+ "bearer_auth" : []
5499
+ },
5500
+ {
5501
+ "basic_auth" : []
5502
+ }
5503
+ ],
5504
+ "responses" : {
5505
+ "200" : {
5506
+ "description" : " Response returned"
5507
+ }
5508
+ }
5509
+ }
5510
+ },
5488
5511
"/ocs/v2.php/apps/notifications/api/{apiVersion}/ex-app-attribute" : {
5489
5512
"post" : {
5490
5513
"operationId" : " ex_app_settings-ex-app-scope-attribute" ,
Original file line number Diff line number Diff line change 797
797
}
798
798
}
799
799
}
800
+ },
801
+ "/index.php/apps/notifications/plain/with-scope" : {
802
+ "get" : {
803
+ "operationId" : " plain-with-scope" ,
804
+ "summary" : " Route with manual scope to not get ignored" ,
805
+ "description" : " This endpoint requires admin access" ,
806
+ "tags" : [
807
+ " plain"
808
+ ],
809
+ "security" : [
810
+ {
811
+ "bearer_auth" : []
812
+ },
813
+ {
814
+ "basic_auth" : []
815
+ }
816
+ ],
817
+ "responses" : {
818
+ "200" : {
819
+ "description" : " Response returned"
820
+ }
821
+ }
822
+ }
800
823
}
801
824
},
802
825
"tags" : []
You can’t perform that action at this time.
0 commit comments