Fixed some inspection issues.

This commit is contained in:
Jan Böhmer 2019-03-20 23:24:20 +01:00
parent e2f7aafa2d
commit 3fe452626d
9 changed files with 25 additions and 27 deletions

View file

@ -76,12 +76,10 @@ class ElementPermissionListener
$annotation = $reader->getPropertyAnnotation($property,
ColumnSecurity::class);
if (null !== $annotation) {
//Check if user is allowed to read info, otherwise apply placeholder
if (!$this->security->isGranted($annotation->getReadOperationName(), $element)) {
$property->setAccessible(true);
$property->setValue($element, $annotation->getPlaceholder());
}
//Check if user is allowed to read info, otherwise apply placeholder
if ((null !== $annotation) && !$this->security->isGranted($annotation->getReadOperationName(), $element)) {
$property->setAccessible(true);
$property->setValue($element, $annotation->getPlaceholder());
}
}
}

View file

@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter;
*/
class PartVoter extends ExtendedVoter
{
const READ = 'read';
public const READ = 'read';
protected function supports($attribute, $subject)
{