In drupal 8 we can use hasPermission() method to check user permission.
$account = \Drupal::currentUser();
$php_access = $account->hasPermission('use php for tracking visibility');
$php_access = $account->hasPermission('use php for tracking visibility');
if(!$php_access) { // User has permission.
// Write your code.
}