Code Duplication    Length = 18-18 lines in 2 locations

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

@@ 217-234 (lines=18) @@
214
            }
215
216
            // Check both 'content/read' and 'content/view_embed'.
217
            if (
218
                !$this->authorizationChecker->isGranted(
219
                    new AuthorizationAttribute(
220
                        'content',
221
                        'read',
222
                        array('valueObject' => $location->contentInfo, 'targets' => $location)
223
                    )
224
                )
225
                && !$this->authorizationChecker->isGranted(
226
                    new AuthorizationAttribute(
227
                        'content',
228
                        'view_embed',
229
                        array('valueObject' => $location->contentInfo, 'targets' => $location)
230
                    )
231
                )
232
            ) {
233
                throw new AccessDeniedException();
234
            }
235
236
            if ($response->isNotModified($this->getRequest())) {
237
                return $response;

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
    }