Commit 8e51c3b2 authored by Dries's avatar Dries

- Patch #898546 by Damien Tournoud: clean up the Filter module upgrade path.

parent 9d912261
This diff is collapsed.
......@@ -349,7 +349,7 @@ function user_update_dependencies() {
// user_update_7006 relies on filter_update_7002.
// TODO: move user_update_7006 down below in the upgrade process.
$dependencies['user'][7006] = array(
'filter' => 7002,
'filter' => 7003,
);
// user_update_7013 relies on system_update_7060.
$dependencies['user'][7013] = array(
......@@ -359,6 +359,31 @@ function user_update_dependencies() {
return $dependencies;
}
/**
* Utility function: grant a set of permissions to a role during update.
*
* @param $rid
* The role ID.
* @param $permissions
* An array of permissions names.
* @param $module
* The name of the module defining the permissions.
*/
function _update_user_role_grant_permissions($rid, array $permissions, $module) {
// Grant new permissions for the role.
foreach ($permissions as $name) {
db_merge('role_permission')
->key(array(
'rid' => $rid,
'permission' => $name,
))
->fields(array(
'module' => $module,
))
->execute();
}
}
/**
* @defgroup user-updates-6.x-to-7.x User updates from 6.x to 7.x
* @{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment