Check user’s role and store in variable

You don’t need to store anything, just check the current logged in user via user_can:

global $current_user;
get_currentuserinfo();
if ( user_can( $current_user, "role_apple" ) ){
  // do something
}

techhipbettruvabetnorabahisbahis forumuedueduseduedueduedusedueduedusedu