Skip to content

Instantly share code, notes, and snippets.

@msonnabaum
Created July 23, 2010 13:34
<?php
function drupal_commons_add_role($name) {
module_load_include('inc', 'user', 'user.admin');
$form_state = array();
$form_state['values']['name'] = $name;
$form_state['values']['op'] = "Add role";
drupal_execute('user_admin_role', $form_state);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment