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
20
20
throw APIException::unauthorized ();
21
21
}
22
22
23
+ if (!$ this ->modx ->hasPermission ('file_create ' )) {
24
+ throw APIException::unauthorized ();
25
+ }
26
+
23
27
$ data = $ request ->getParsedBody ();
24
28
25
29
$ url = $ this ->modx ->getOption ('url ' , $ data );
@@ -79,6 +83,10 @@ public function post(ServerRequestInterface $request): void
79
83
throw new LexiconException ('modai.error.source_init failed ' );
80
84
}
81
85
86
+ if (!$ source ->checkPolicy ('create ' )) {
87
+ throw APIException::unauthorized ();
88
+ }
89
+
82
90
$ path = Settings::getImageSetting ($ this ->modx , $ field , 'path ' );
83
91
$ filePath = $ this ->createFilePath ($ path , $ resource );
84
92
You can’t perform that action at this time.
0 commit comments