Created
November 7, 2011 21:57
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add a "silverpop form bean creators" role for users who can create beans of silverpop_form type. | |
*/ | |
function energy_content_update_7046(&$sandbox) { | |
$perms = array(); | |
$new_role = new stdClass(); | |
$new_role->name = 'silverpop form block creators'; | |
$status = user_role_save($new_role); | |
$perms = array(); | |
$perms[] = 'create any silverpop form bean'; | |
$perms[] = 'edit any silverpop form bean'; | |
$perms[] = 'view any silverpop form bean'; | |
$perms[] = 'delete any silverpop form bean'; | |
bean_reset(); | |
if ($status) { | |
$role = user_role_load_by_name($new_role->name); | |
debug($role->rid); | |
user_role_grant_permissions($role->rid, $perms); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment