Skip to content
Snippets Groups Projects

Add .gitlab-ci.yml

Files
5
@@ -2,10 +2,10 @@
namespace Drupal\required_by_role\Plugin\Required;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\required_api\Plugin\Required\RequiredBase;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\required_api\Plugin\Required\RequiredBase;
use Drupal\user\Entity\Role;
/**
@@ -62,7 +62,9 @@ class RequiredByRole extends RequiredBase {
$default_value = $field->getThirdPartySetting('required_api', 'required_plugin_options') ?: [];
$options = array_map(
function ($role) { return ['name' => $role->label()]; },
function ($role) {
return ['name' => $role->label()];
},
Role::loadMultiple()
);
unset($options[AccountInterface::AUTHENTICATED_ROLE]);
Loading