Skip to content
Snippets Groups Projects
Unverified Commit d8a2574a authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #25810 from eileenmcnaughton/import_subscriber

#4184 Fix Import over-authorization
parents ff32212b 250b13bc
Branches
Tags
No related merge requests found
......@@ -104,7 +104,7 @@ class ImportSubscriber extends AutoService implements EventSubscriberInterface {
public function onApiAuthorize(AuthorizeEvent $event): void {
$apiRequest = $event->getApiRequest();
$entity = $apiRequest['entity'];
if (strpos($entity, 'Import_') === 0) {
if (strpos($entity, 'Import_') === 0 && !in_array($event->getActionName(), ['getFields', 'getActions', 'checkAccess'], TRUE)) {
$userJobID = (int) (str_replace('Import_', '', $entity));
if (!UserJob::get(TRUE)->addWhere('id', '=', $userJobID)->selectRowCount()->execute()->count()) {
throw new UnauthorizedException('Import access not permitted');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment