Disable a menu item based on a condition

In my site, I have a menu with 4 items by default. After I have installed the private messaging plugin, I added a new menu item which links to the inbox of the private messaging.

To add this menu item, I added the following code to functions.php:

function cs_add_dropdown_menu(){ ?>

<li role="presentation">

  <a role="menuitem" tabindex="-1" href="https://bioinfexperts.com/inbox/">

<i class="fa fa-arrow-right"></i><?php _e("Inbox", ET_DOMAIN) ?>




What I need is that, a user with role 'FREELANCER' cannot use private messaging if he has not completed hie profile and filled all the necessary information. The 'if' condition for this is the following:

if(!$checkProfile || !is_numeric($user_profile_id))
     then, disable menu item for private messaging if this user is a freelancer ($role == FREELANCER)

Could you please assist me in where should I place this code?