src/Versioned.php
public function canRevertToLive($member = null)
    {
        $owner = $this->owner;

        // Skip if invoked by extendedCan()
        if (func_num_args() > 4) {
            return null;
        }

        // Can't revert if not on live
        if (!$owner->isPublished()) {
            return false;
        }

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

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

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

        // Default to canEdit
        return $owner->canEdit($member);
    }
public function canRevertToLive($member = null)
    {
        $owner = $this->owner;

        // Skip if invoked by extendedCan()
        if (func_num_args() > 4) {
            return null;
        }

        // Can't revert if not on live
        if (!$owner->isPublished()) {
            return false;
        }

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

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

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

        // Default to canEdit
        return $owner->canEdit($member);
    }
public function canRevertToLive ( $ member = null ) { $ owner = $ this -> owner ; // Skip if invoked by extendedCan() if ( func_num_args ( ) > 4 ) { return null ; } // Can't revert if not on live if ( ! $ owner -> isPublished ( ) ) { return false ; } if ( ! $ member ) { $ member = Security :: getCurrentUser ( ) ; } if ( Permission :: checkMember ( $ member , "ADMIN" ) ) { return true ; } // Standard mechanism for accepting permission changes from extensions $ extended = $ owner -> extendedCan ( 'canRevertToLive' , $ member ) ; if ( $ extended !== null ) { return $ extended ; } // Default to canEdit return $ owner -> canEdit ( $ member ) ; }
Check if the user can revert this record to live

@param Member $member
@return bool
Check if the user can revert this record to live