You are here

function getPermissionByModeAndRole in Form Mode Control 8

Parameters

$mode:

$id_role:

$display_query:

Return value

mixed

1 call to getPermissionByModeAndRole()
controlAccessFormMode in ./form_mode_control.module

File

./form_mode_control.module, line 78

Code

function getPermissionByModeAndRole($display_query, $configuration, $context) {
  $extractConfigPermissionByDisplay = extractConfigPermissionByDisplay($configuration);
  $entity_type = $context['entity_type'];
  $bundle = $context['bundle'];
  $id = "{$entity_type}.{$bundle}.{$display_query}";
  if ($extractConfigPermissionByDisplay[$id] != NULL && \Drupal\Core\Entity\Entity\EntityFormDisplay::load($id)
    ->status() == TRUE) {
    return $extractConfigPermissionByDisplay[$id];
  }
}