File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
core/components/modai/src/API/Download Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ public function post(ServerRequestInterface $request): void
2020 throw APIException::unauthorized ();
2121 }
2222
23+ if (!$ this ->modx ->hasPermission ('file_create ' )) {
24+ throw APIException::unauthorized ();
25+ }
26+
2327 $ data = $ request ->getParsedBody ();
2428
2529 $ url = $ this ->modx ->getOption ('url ' , $ data );
@@ -79,6 +83,10 @@ public function post(ServerRequestInterface $request): void
7983 throw new LexiconException ('modai.error.source_init failed ' );
8084 }
8185
86+ if (!$ source ->checkPolicy ('create ' )) {
87+ throw APIException::unauthorized ();
88+ }
89+
8290 $ path = Settings::getImageSetting ($ this ->modx , $ field , 'path ' );
8391 $ filePath = $ this ->createFilePath ($ path , $ resource );
8492
You can’t perform that action at this time.
0 commit comments