How to get the field of ACF when editing post?

Here is my situation:
I want to let some users have some capability temporary when they choose some option.
So,I use this code:

function author_cap_filter( $allcaps, $cap, $args ) {
	global $current_user;
	$field = get_field("is_tw");

	if( $field == "true" )  //"is_tw" is the custome field I set in ACF.
		global $post;
		$id = $post->ID;
		$status = get_post_status($id);

		$allcaps['publish_posts'] = 0; //This is the limitation of diable the ability of publishing post temporary.

	return $allcaps;

add_filter( 'user_has_cap', 'author_cap_filter', 10, 3 );

However,it’s useless.Please help me to fix this.

Here is the ACF documents(