1313
1414namespace Pimcore \Bundle \StudioBackendBundle \Gdpr \Service ;
1515
16+ use JsonException ;
1617use Pimcore \Bundle \StudioBackendBundle \Exception \Api \ForbiddenException ;
18+ use Pimcore \Bundle \StudioBackendBundle \Exception \Api \InvalidArgumentException ;
1719use Pimcore \Bundle \StudioBackendBundle \Gdpr \Event \PreResponse \GdprDataProviderEvent ;
1820use Pimcore \Bundle \StudioBackendBundle \Gdpr \Event \PreResponse \GdprSearchResultEvent ;
1921use Pimcore \Bundle \StudioBackendBundle \Gdpr \MappedParameter \GdprStructuredSearchRequest ;
2628use Pimcore \Bundle \StudioBackendBundle \Util \Constant \HttpResponseCodes ;
2729use Pimcore \Bundle \StudioBackendBundle \Util \Constant \HttpResponseHeaders ;
2830use Pimcore \Bundle \StudioBackendBundle \Util \Trait \StreamedResponseTrait ;
29- use Pimcore \Bundle \StudioBackendBundle \Exception \Api \InvalidArgumentException ;
3031use Symfony \Component \HttpFoundation \StreamedResponse ;
3132use Symfony \Contracts \EventDispatcher \EventDispatcherInterface ;
32- use JsonException ;
3333use function count ;
3434use function sprintf ;
3535use function strlen ;
@@ -67,7 +67,7 @@ public function search(GdprStructuredSearchRequest $request): GdprSearchResultCo
6767
6868 foreach ($ request ->providers as $ providerKey ) {
6969 $ provider = $ this ->loader ->resolve ($ providerKey );
70-
70+
7171 $ this ->checkProviderPermission ($ provider );
7272
7373 $ results = $ provider ->findData ($ request ->searchTerms );
@@ -90,7 +90,7 @@ public function search(GdprStructuredSearchRequest $request): GdprSearchResultCo
9090 public function getExportDataAsJson (int $ id , string $ providerKey ): StreamedResponse
9191 {
9292 $ provider = $ this ->loader ->resolve ($ providerKey );
93-
93+
9494 $ this ->checkProviderPermission ($ provider );
9595
9696 $ data = $ provider ->getSingleItemForDownload ($ id ); //id is a single item of a particular provider
@@ -204,6 +204,7 @@ private function checkProviderPermission(DataProviderInterface $provider): void
204204 foreach ($ permissions as $ permission ) {
205205 if ($ currentUser ->isAllowed ($ permission )) {
206206 $ isGranted = true ;
207+
207208 break ;
208209 }
209210 }
0 commit comments