backdrop-contrib / backdrop-drush-extension

A set of commands and boot class for Drush and Backdrop CMS.
GNU General Public License v2.0
13 stars 18 forks source link

Add support for drush user-add-role (urol) #204

Open herbdool opened 4 years ago

herbdool commented 4 years ago

Duplicate functionality of https://drushcommands.com/drush-8x/user/user-add-role/, adding roles to specified user accounts.

totten commented 4 years ago

I'm certain there's a better PHP function to call (e.g. firing any needful hooks) -- but just as a reference point, for civicrm infra/ops#906, we used this SQL as quick-n-dirty work-around:

INSERT IGNORE INTO users_roles (uid,role)
SELECT uid, "the_role_name" 
FROM users 
WHERE name = "the_user_name";

(Adapted from backdrop-demo/install.sh @ 8b2067f)