Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
required_by_role
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
required_by_role
Merge requests
!6
Add .gitlab-ci.yml
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add .gitlab-ci.yml
issue/required_by_role-3491629:3491629-add-gitlab-ci
into
8.x-1.x
Overview
0
Commits
5
Pipelines
6
Changes
5
Merged
Dieter Holvoet
requested to merge
issue/required_by_role-3491629:3491629-add-gitlab-ci
into
8.x-1.x
1 month ago
Overview
0
Commits
5
Pipelines
6
Changes
5
Expand
Closes
#3491629
👍
0
👎
0
Merge request reports
Compare
8.x-1.x
version 5
ee07be06
4 weeks ago
version 4
e528dc62
4 weeks ago
version 3
97f23337
1 month ago
version 2
0d2a901c
1 month ago
version 1
590d594f
1 month ago
8.x-1.x (base)
and
latest version
latest version
ee07be06
5 commits,
4 weeks ago
version 5
ee07be06
5 commits,
4 weeks ago
version 4
e528dc62
4 commits,
4 weeks ago
version 3
97f23337
3 commits,
1 month ago
version 2
0d2a901c
2 commits,
1 month ago
version 1
590d594f
1 commit,
1 month ago
5 files
+
58
−
58
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
src/Plugin/Required/RequiredByRole.php
+
5
−
3
Options
@@ -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\RequiredBas
e
;
use
Drupal\
Core\Session\AccountInterfac
e
;
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