You are here

public function AdminContentNotificationService::isCurrentUserRoleAllowedToSendNotification in Admin Content Notification 8.3

Check if current user allowed to send admin content notification.

Return value

bool Return true if allowed to send admin content notification.

File

src/AdminContentNotificationService.php, line 104

Class

AdminContentNotificationService
AdminContentNotificationService implement helper service class.

Namespace

Drupal\admin_content_notification

Code

public function isCurrentUserRoleAllowedToSendNotification() {
  $roles = $this->account
    ->getRoles();
  $trigger_for_roles = $this
    ->getConfigs()
    ->get('admin_content_notification_allowed_roles') ?: [];
  return count(array_intersect(array_filter($trigger_for_roles), $roles));
}