Code Duplication    Length = 18-18 lines in 2 locations

eZ/Publish/Core/MVC/Symfony/FieldType/RichText/Renderer.php 1 location

@@ 424-441 (lines=18) @@
421
        );
422
423
        // Check both 'content/read' and 'content/view_embed'.
424
        if (
425
            !$this->authorizationChecker->isGranted(
426
                new AuthorizationAttribute(
427
                    'content',
428
                    'read',
429
                    array('valueObject' => $location->contentInfo, 'targets' => $location)
430
                )
431
            )
432
            && !$this->authorizationChecker->isGranted(
433
                new AuthorizationAttribute(
434
                    'content',
435
                    'view_embed',
436
                    array('valueObject' => $location->contentInfo, 'targets' => $location)
437
                )
438
            )
439
        ) {
440
            throw new AccessDeniedException();
441
        }
442
443
        return $location;
444
    }

eZ/Publish/Core/MVC/Symfony/Controller/Content/ViewController.php 1 location

@@ 229-246 (lines=18) @@
226
            }
227
228
            // Check both 'content/read' and 'content/view_embed'.
229
            if (
230
                !$this->authorizationChecker->isGranted(
231
                    new AuthorizationAttribute(
232
                        'content',
233
                        'read',
234
                        array('valueObject' => $location->contentInfo, 'targets' => $location)
235
                    )
236
                )
237
                && !$this->authorizationChecker->isGranted(
238
                    new AuthorizationAttribute(
239
                        'content',
240
                        'view_embed',
241
                        array('valueObject' => $location->contentInfo, 'targets' => $location)
242
                    )
243
                )
244
            ) {
245
                throw new AccessDeniedException();
246
            }
247
248
            if ($response->isNotModified($this->getRequest())) {
249
                return $response;