Commit a28d09eb authored by webchick's avatar webchick

Issue #1944344 by swentel: Fixed field_ui_update_8001 deletes permissions.

parent c309e0e5
...@@ -41,10 +41,5 @@ function field_ui_update_8001() { ...@@ -41,10 +41,5 @@ function field_ui_update_8001() {
} }
$query->execute(); $query->execute();
} }
// Remove old permission.
db_delete('role_permission')
->condition('permission', $old_permission)
->execute();
} }
} }
...@@ -66,7 +66,7 @@ function testFieldUIPermissions() { ...@@ -66,7 +66,7 @@ function testFieldUIPermissions() {
$role_permissions = user_role_permissions(array($this->normal_role_id => $this->normal_role_name, $this->admin_role_id => $this->admin_role_name)); $role_permissions = user_role_permissions(array($this->normal_role_id => $this->normal_role_name, $this->admin_role_id => $this->admin_role_name));
foreach ($permissions as $old_permission => $new_permissions) { foreach ($permissions as $old_permission => $new_permissions) {
$this->assertFalse(isset($role_permissions[$this->normal_role_id][$old_permission]), format_string('%role_name does not have the old %permission permission', array('%role_name' => $this->normal_role_name, '%permission' => $old_permission))); $this->assertFalse(isset($role_permissions[$this->normal_role_id][$old_permission]), format_string('%role_name does not have the old %permission permission', array('%role_name' => $this->normal_role_name, '%permission' => $old_permission)));
$this->assertFalse(isset($role_permissions[$this->admin_role_id][$old_permission]), format_string('%role_name does not have the old %permission permission', array('%role_name' => $this->admin_role_name, '%permission' => $old_permission))); $this->assertTrue(isset($role_permissions[$this->admin_role_id][$old_permission]), format_string('%role_name still has the old %permission permission', array('%role_name' => $this->admin_role_name, '%permission' => $old_permission)));
foreach ($new_permissions as $new_permission) { foreach ($new_permissions as $new_permission) {
$this->assertFalse(isset($role_permissions[$this->normal_role_id][$new_permission]), format_string('%role_name does not have the new %permission permission', array('%role_name' => $this->normal_role_name, '%permission' => $new_permission))); $this->assertFalse(isset($role_permissions[$this->normal_role_id][$new_permission]), format_string('%role_name does not have the new %permission permission', array('%role_name' => $this->normal_role_name, '%permission' => $new_permission)));
$this->assertTrue(isset($role_permissions[$this->admin_role_id][$new_permission]), format_string('%role_name has the new %permission permission', array('%role_name' => $this->admin_role_name, '%permission' => $new_permission))); $this->assertTrue(isset($role_permissions[$this->admin_role_id][$new_permission]), format_string('%role_name has the new %permission permission', array('%role_name' => $this->admin_role_name, '%permission' => $new_permission)));
......
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