Пример #1
0
 public function canRead()
 {
     if (!$this->isFull) {
         return true;
     }
     if (!$this->topicExists()) {
         return false;
     }
     if (self::user() && $this->topicExists())
     {
         return true;
     }
     return parent::canRead();
 }
    /**
     * @return bool
     */
    public function canRead()
    {
        header('Pragma: no-cache');
        header('cache-Control: no-cache, must-revalidate');
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
        //header('X-Frame-Options: SAMEORIGIN');
        header('X-Frame-Options: ALLOW-FROM https://*.facebook.com/');
        $appsWithoutHeader = array(
            'social-register',
            'social-register-confirmation',
        );
        if ( in_array( $this->getApplicationIdentifier(), $appsWithoutHeader ) )
        {
            header('X-Frame-Options:');
        }
        header('Content-Security-Policy: frame-ancestors https://*.facebook.com/');

        return parent::canRead();
    }
    /**
     * @return bool
     */
    public function canRead()
    {
        $canRead = $this->applicationLocalized->getPermissionHandler()->canRead(
            array(
                'isFull' => $this->isFull,
                'isPublic' => $this->isPublic,
                'node' => $this->node,
            )
        );

        if ($canRead === null) {
            return parent::canRead();
        }

        return $canRead;
    }