ObjectFilter/ObjectFilter.php
protected function isRestoreViewGranted(FieldVote $fieldVote, array $values)
    {
        $event = new RestoreViewGrantedEvent($fieldVote, $values['old'], $values['new']);
        $this->dispatcher->dispatch(ObjectFilterEvents::RESTORE_VIEW_GRANTED, $event);

        if ($event->isSkipAuthorizationChecker()) {
            return !$event->isGranted();
        }

        return !$this->ac->isGranted('perm_read', $fieldVote)
            || !$this->ac->isGranted('perm_edit', $fieldVote);
    }
protected function isRestoreViewGranted(FieldVote $fieldVote, array $values)
    {
        $event = new RestoreViewGrantedEvent($fieldVote, $values['old'], $values['new']);
        $this->dispatcher->dispatch(ObjectFilterEvents::RESTORE_VIEW_GRANTED, $event);

        if ($event->isSkipAuthorizationChecker()) {
            return !$event->isGranted();
        }

        return !$this->ac->isGranted('perm_read', $fieldVote)
            || !$this->ac->isGranted('perm_edit', $fieldVote);
    }
protected function isRestoreViewGranted ( FieldVote $ fieldVote , array $ values ) { $ event = new RestoreViewGrantedEvent ( $ fieldVote , $ values [ 'old' ] , $ values [ 'new' ] ) ; $ this -> dispatcher -> dispatch ( ObjectFilterEvents :: RESTORE_VIEW_GRANTED , $ event ) ; if ( $ event -> isSkipAuthorizationChecker ( ) ) { return ! $ event -> isGranted ( ) ; } return ! $ this -> ac -> isGranted ( 'perm_read' , $ fieldVote ) || ! $ this -> ac -> isGranted ( 'perm_edit' , $ fieldVote ) ; }
Check if the field value must be restored.

@param FieldVote $fieldVote The field vote
@param array     $values    The map of old and new values

@return bool
Check if the field value must be restored .