Drush commands for adding users to groups

Created on 30 July 2018, about 6 years ago
Updated 24 June 2024, 3 months ago

With og in Drupal 7, I had the ability to add users to existing groups with drush commands. It looked like:

drush @local user-add-role 'Site Admin' test_siteadmin
drush @local user-add-role 'Site Editor' test_contributor
drush @local user-add-role 'Site Editor' test_reviewer
drush @local user-add-role 'Site Editor' test_approver
drush @local og-add-user node site_group 'content approver' test_siteadmin
drush @local og-add-user node site_group 'content contributor' test_contributor
drush @local og-add-user node site_group 'content reviewer' test_reviewer
drush @local og-add-user node site_group 'content approver' test_approver

So on my local test builds, I could automate adding users to groups for testing. It would be great to have a drush command for group. Something like:

drush @local group-add-user site_group 'content approver' test_approver
✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States shelane

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States shelane

    I updated this patch to use the new Drush 12 spec. There is no longer an entry in the composer.json file, no drush.services.yml file as dependencies are injected in the create method, and annotations are converted to attributes.

  • πŸ‡ΊπŸ‡ΈUnited States shelane

    Drush 12.5 uses autowire. I've updated the patch to include this.

Production build 0.71.5 2024