By hari, 2 August, 2023 <?php $roles = \Drupal::currentUser()->getRoles(); if(in_array('editor', $roles)) { // Logic for editor role user } Tags Drupal