Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
drupalorg
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
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
drupalorg
Commits
96292f81
Commit
96292f81
authored
5 months ago
by
Fran Garcia-Linares
Browse files
Options
Downloads
Patches
Plain Diff
New command to resync roles.
parent
b8e18040
Branches
Branches containing commit
Tags
6.x-2.0-beta3
Tags containing commit
1 merge request
!315
Issue #3494493 Sponsor widget
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Commands/DrushCommands.php
+22
-0
22 additions, 0 deletions
src/Commands/DrushCommands.php
with
22 additions
and
0 deletions
src/Commands/DrushCommands.php
+
22
−
0
View file @
96292f81
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
Drupal\drupalorg\Commands
;
namespace
Drupal\drupalorg\Commands
;
use
Drupal\Core\Site\Settings
;
use
Drupal\drupalorg\Utilities\ActiveInstalls
;
use
Drupal\drupalorg\Utilities\ActiveInstalls
;
use
Drupal\drupalorg\Utilities\ComposerNamespace
;
use
Drupal\drupalorg\Utilities\ComposerNamespace
;
use
Drupal\drupalorg\Utilities\CoreCompatibility
;
use
Drupal\drupalorg\Utilities\CoreCompatibility
;
...
@@ -80,4 +81,25 @@ class DrushCommands extends BaseDrushCommands {
...
@@ -80,4 +81,25 @@ class DrushCommands extends BaseDrushCommands {
}
}
}
}
/**
* This is a D10 role only which gets overwritten when a user is re-synced via migrations.
*
* @command drupalorg:fix-landing-page-administrator-role
* @usage drush drupalorg:fix-landing-page-administrator-role
*/
public
function
fixLandingPageAdministratorRoles
()
{
$allowed_users
=
Settings
::
get
(
'drupalorg_allowed_users'
);
if
(
is_array
(
$allowed_users
))
{
foreach
(
$allowed_users
as
$allowed_user
)
{
if
(
$allowed_user
!==
'*'
)
{
$user
=
user_load_by_name
(
$allowed_user
);
if
(
$user
)
{
$user
->
addRole
(
'landing_pages_administrator'
);
$user
->
save
();
}
}
}
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment