src/Versioned.php
public function canArchive($member = null)
    {
        // Skip if invoked by extendedCan()
        if (func_num_args() > 4) {
            return null;
        }

        if (!$member) {
            $member = Security::getCurrentUser();
        }

        // Standard mechanism for accepting permission changes from extensions
        $owner = $this->owner;
        $extended = $owner->extendedCan('canArchive', $member);
        if ($extended !== null) {
            return $extended;
        }

        // Admin permissions allow
        if (Permission::checkMember($member, "ADMIN")) {
            return true;
        }

        // Check if this record can be deleted from stage
        if (!$owner->canDelete($member)) {
            return false;
        }

        // Check if we can delete from live
        if (!$owner->canUnpublish($member)) {
            return false;
        }

        return true;
    }
public function canArchive($member = null)
    {
        // Skip if invoked by extendedCan()
        if (func_num_args() > 4) {
            return null;
        }

        if (!$member) {
            $member = Security::getCurrentUser();
        }

        // Standard mechanism for accepting permission changes from extensions
        $owner = $this->owner;
        $extended = $owner->extendedCan('canArchive', $member);
        if ($extended !== null) {
            return $extended;
        }

        // Admin permissions allow
        if (Permission::checkMember($member, "ADMIN")) {
            return true;
        }

        // Check if this record can be deleted from stage
        if (!$owner->canDelete($member)) {
            return false;
        }

        // Check if we can delete from live
        if (!$owner->canUnpublish($member)) {
            return false;
        }

        return true;
    }
public function canArchive ( $ member = null ) { // Skip if invoked by extendedCan() if ( func_num_args ( ) > 4 ) { return null ; } if ( ! $ member ) { $ member = Security :: getCurrentUser ( ) ; } // Standard mechanism for accepting permission changes from extensions $ owner = $ this -> owner ; $ extended = $ owner -> extendedCan ( 'canArchive' , $ member ) ; if ( $ extended !== null ) { return $ extended ; } // Admin permissions allow if ( Permission :: checkMember ( $ member , "ADMIN" ) ) { return true ; } // Check if this record can be deleted from stage if ( ! $ owner -> canDelete ( $ member ) ) { return false ; } // Check if we can delete from live if ( ! $ owner -> canUnpublish ( $ member ) ) { return false ; } return true ; }
Check if the current user is allowed to archive this record.
If extended, ensure that both canDelete and canUnpublish are extended also

@param Member $member
@return bool
Check if the current user is allowed to archive this record . If extended ensure that both canDelete and canUnpublish are extended also