app/GedcomRecord.php
private function canShowRecord(int $access_level): bool
    {
        // This setting would better be called "$ENABLE_PRIVACY"
        if (!$this->tree->getPreference('HIDE_LIVE_PEOPLE')) {
            return true;
        }

        // We should always be able to see our own record (unless an admin is applying download restrictions)
        if ($this->xref() === $this->tree->getUserPreference(Auth::user(), 'gedcomid') && $access_level === Auth::accessLevel($this->tree)) {
            return true;
        }

        // Does this record have a RESN?
        if (strpos($this->gedcom, "\n1 RESN confidential") !== false) {
            return Auth::PRIV_NONE >= $access_level;
        }
        if (strpos($this->gedcom, "\n1 RESN privacy") !== false) {
            return Auth::PRIV_USER >= $access_level;
        }
        if (strpos($this->gedcom, "\n1 RESN none") !== false) {
            return true;
        }

        // Does this record have a default RESN?
        $individual_privacy = $this->tree->getIndividualPrivacy();
        if (isset($individual_privacy[$this->xref()])) {
            return $individual_privacy[$this->xref()] >= $access_level;
        }

        // Privacy rules do not apply to admins
        if (Auth::PRIV_NONE >= $access_level) {
            return true;
        }

        // Different types of record have different privacy rules
        return $this->canShowByType($access_level);
    }
private function canShowRecord(int $access_level): bool
    {
        // This setting would better be called "$ENABLE_PRIVACY"
        if (!$this->tree->getPreference('HIDE_LIVE_PEOPLE')) {
            return true;
        }

        // We should always be able to see our own record (unless an admin is applying download restrictions)
        if ($this->xref() === $this->tree->getUserPreference(Auth::user(), 'gedcomid') && $access_level === Auth::accessLevel($this->tree)) {
            return true;
        }

        // Does this record have a RESN?
        if (strpos($this->gedcom, "\n1 RESN confidential") !== false) {
            return Auth::PRIV_NONE >= $access_level;
        }
        if (strpos($this->gedcom, "\n1 RESN privacy") !== false) {
            return Auth::PRIV_USER >= $access_level;
        }
        if (strpos($this->gedcom, "\n1 RESN none") !== false) {
            return true;
        }

        // Does this record have a default RESN?
        $individual_privacy = $this->tree->getIndividualPrivacy();
        if (isset($individual_privacy[$this->xref()])) {
            return $individual_privacy[$this->xref()] >= $access_level;
        }

        // Privacy rules do not apply to admins
        if (Auth::PRIV_NONE >= $access_level) {
            return true;
        }

        // Different types of record have different privacy rules
        return $this->canShowByType($access_level);
    }
private function canShowRecord ( int $ access_level ) : bool { // This setting would better be called "$ENABLE_PRIVACY" if ( ! $ this -> tree -> getPreference ( 'HIDE_LIVE_PEOPLE' ) ) { return true ; } // We should always be able to see our own record (unless an admin is applying download restrictions) if ( $ this -> xref ( ) === $ this -> tree -> getUserPreference ( Auth :: user ( ) , 'gedcomid' ) && $ access_level === Auth :: accessLevel ( $ this -> tree ) ) { return true ; } // Does this record have a RESN? if ( strpos ( $ this -> gedcom , "\n1 RESN confidential" ) !== false ) { return Auth :: PRIV_NONE >= $ access_level ; } if ( strpos ( $ this -> gedcom , "\n1 RESN privacy" ) !== false ) { return Auth :: PRIV_USER >= $ access_level ; } if ( strpos ( $ this -> gedcom , "\n1 RESN none" ) !== false ) { return true ; } // Does this record have a default RESN? $ individual_privacy = $ this -> tree -> getIndividualPrivacy ( ) ; if ( isset ( $ individual_privacy [ $ this -> xref ( ) ] ) ) { return $ individual_privacy [ $ this -> xref ( ) ] >= $ access_level ; } // Privacy rules do not apply to admins if ( Auth :: PRIV_NONE >= $ access_level ) { return true ; } // Different types of record have different privacy rules return $ this -> canShowByType ( $ access_level ) ; }
Work out whether this record can be shown to a user with a given access level

@param int $access_level

@return bool
Work out whether this record can be shown to a user with a given access level