code/extensions/CDNFile.php
public function getViewType() {
        $perm = null;

        if ($this->owner->CanViewType == 'Inherit') {
            if ($this->owner->ParentID) {
                $perm = $this->owner->Parent()->getViewType();
            } else {
                $member = Member::currentUser();
                $perm = $this->owner->defaultPermissions($member);
            }
        } else {
            $perm = $this->owner->CanViewType;
        }

		$default = Config::inst()->get('SecureAssets', 'Defaults');

		$default = isset($default['Permission']) ? $default['Permission'] : CDNFile::ANYONE_PERM;

        return $perm ? $perm : $default;
	}
public function getViewType() {
        $perm = null;

        if ($this->owner->CanViewType == 'Inherit') {
            if ($this->owner->ParentID) {
                $perm = $this->owner->Parent()->getViewType();
            } else {
                $member = Member::currentUser();
                $perm = $this->owner->defaultPermissions($member);
            }
        } else {
            $perm = $this->owner->CanViewType;
        }

		$default = Config::inst()->get('SecureAssets', 'Defaults');

		$default = isset($default['Permission']) ? $default['Permission'] : CDNFile::ANYONE_PERM;

        return $perm ? $perm : $default;
	}
public function getViewType ( ) { $ perm = null ; if ( $ this -> owner -> CanViewType == 'Inherit' ) { if ( $ this -> owner -> ParentID ) { $ perm = $ this -> owner -> Parent ( ) -> getViewType ( ) ; } else { $ member = Member :: currentUser ( ) ; $ perm = $ this -> owner -> defaultPermissions ( $ member ) ; } } else { $ perm = $ this -> owner -> CanViewType ; } $ default = Config :: inst ( ) -> get ( 'SecureAssets' , 'Defaults' ) ; $ default = isset ( $ default [ 'Permission' ] ) ? $ default [ 'Permission' ] : CDNFile :: ANYONE_PERM ; return $ perm ? $ perm : $ default ; }
Climbs the folder hierarchy until there's a CanViewType that does not equal Inherit

@return String The first valid CanViewType of this File
Climbs the folder hierarchy until there s a CanViewType that does not equal Inherit