You are here

public function WebformGroupManager::getCurrentUserGroupRoles in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_group/src/WebformGroupManager.php \Drupal\webform_group\WebformGroupManager::getCurrentUserGroupRoles()

Get the current user's group roles.

Return value

array|bool An array containing the current user's group roles. FALSE if no group content is found for the current request.

Overrides WebformGroupManagerInterface::getCurrentUserGroupRoles

File

modules/webform_group/src/WebformGroupManager.php, line 139

Class

WebformGroupManager
Webform group manager manager.

Namespace

Drupal\webform_group

Code

public function getCurrentUserGroupRoles() {
  if (isset($this->currentGroupRoles)) {
    return $this->currentGroupRoles;
  }
  $group_content = $this
    ->getCurrentGroupContent();
  $this->currentGroupRoles = $group_content ? $this
    ->getUserGroupRoles($group_content, $this->currentUser) : [];
  return $this->currentGroupRoles;
}