Authenticating user for custom post type [closed]

No, the function current_user_can_for_blog expects a blog ID to be passed to it, not a post ID. I would change it to be like this:

if( isset( $_POST['post_type'] ) && $_POST['post_type'] != 'portfolio' ) {
    if ( !current_user_can( $post_id, 'edit_post' ) ) 
        return;
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)