File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 19
19
use Psr \Http \Message \ServerRequestInterface as Request ;
20
20
use Tobyz \JsonApiServer \Adapter \AdapterInterface ;
21
21
use Tobyz \JsonApiServer \Exception \BadRequestException ;
22
+ use Tobyz \JsonApiServer \Exception \ForbiddenException ;
22
23
use Tobyz \JsonApiServer \JsonApi ;
23
24
use Tobyz \JsonApiServer \ResourceType ;
24
25
use Tobyz \JsonApiServer \Schema \Attribute ;
@@ -51,6 +52,10 @@ public function handle(Context $context): ResponseInterface
51
52
$ adapter = $ this ->resource ->getAdapter ();
52
53
$ schema = $ this ->resource ->getSchema ();
53
54
55
+ if (! evaluate ($ schema ->isListable (), [$ context ])) {
56
+ throw new ForbiddenException ;
57
+ }
58
+
54
59
$ query = $ adapter ->newQuery ();
55
60
56
61
run_callbacks ($ schema ->getListeners ('listing ' ), [$ query , $ context ]);
You can’t perform that action at this time.
0 commit comments