getUser($request), $resource)) { throw new AuthorizationFailedException(); } if (!$resource->type instanceof CustomFiles) { return $response; } return $this->getContentResponse($resource->type->getCustomFiles()); } }