Security to delete post by Admin

At first, read something about WordPress Ajax API and about Roles and Capabilities – capability to “edit_posts” has even Contributor. I would suggest to check for ‘delete_others_posts’ to prove the user is at least Editor. Or use capability of ‘manage_options’ (has Administrator, not Editor).

Further, there is a check ajax referer function for you to help prevent entries from outside your website. Read more about nonces also.

Here is an example from the codex on using nonces when in AJAX:

In your main file, set the nonce like this:

<script type="text/javascript">
jQuery(document).ready(function($){
    var data = {
        action: 'my_action',
        security: '<?php echo $ajax_nonce; ?>',
        my_string: 'Hello World!'
    };
    $.post(ajaxurl, data, function(response) {
        alert("Response: " + response);
    });
});
</script>

In your ajax file, check the referrer like this:

add_action( 'wp_ajax_my_action', 'my_action_function' );
function my_action_function() {
    check_ajax_referer( 'my-special-string', 'security' );
    echo $_POST['my_string'];
    die;
}