ObjectFilter/ObjectFilter.php
protected function isViewGranted($object)
    {
        if ($object instanceof FieldVote) {
            $eventName = ObjectFilterEvents::OBJECT_FIELD_VIEW_GRANTED;
            $event = new ObjectFieldViewGrantedEvent($object);
            $permission = 'perm_read';
        } else {
            $eventName = ObjectFilterEvents::OBJECT_VIEW_GRANTED;
            $event = new ObjectViewGrantedEvent($object);
            $permission = 'perm_view';
        }

        $this->dispatcher->dispatch($eventName, $event);

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

        return $this->ac->isGranted($permission, $object);
    }
protected function isViewGranted($object)
    {
        if ($object instanceof FieldVote) {
            $eventName = ObjectFilterEvents::OBJECT_FIELD_VIEW_GRANTED;
            $event = new ObjectFieldViewGrantedEvent($object);
            $permission = 'perm_read';
        } else {
            $eventName = ObjectFilterEvents::OBJECT_VIEW_GRANTED;
            $event = new ObjectViewGrantedEvent($object);
            $permission = 'perm_view';
        }

        $this->dispatcher->dispatch($eventName, $event);

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

        return $this->ac->isGranted($permission, $object);
    }
protected function isViewGranted ( $ object ) { if ( $ object instanceof FieldVote ) { $ eventName = ObjectFilterEvents :: OBJECT_FIELD_VIEW_GRANTED ; $ event = new ObjectFieldViewGrantedEvent ( $ object ) ; $ permission = 'perm_read' ; } else { $ eventName = ObjectFilterEvents :: OBJECT_VIEW_GRANTED ; $ event = new ObjectViewGrantedEvent ( $ object ) ; $ permission = 'perm_view' ; } $ this -> dispatcher -> dispatch ( $ eventName , $ event ) ; if ( $ event -> isSkipAuthorizationChecker ( ) ) { return $ event -> isGranted ( ) ; } return $ this -> ac -> isGranted ( $ permission , $ object ) ; }
Check if the object or object field can be seen.

@param FieldVote|object $object The object or field vote

@return bool
Check if the object or object field can be seen .