From 5d76008993fc7edc5d4c1aedba8af81b36d1554e Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Tue, 5 Oct 2010 06:17:29 +0000 Subject: #438224 by dww, sun, netsensei, vordude, et al: 'Post comments without approval' permission name is completely misleading. --- modules/user/user.install | 14 ++++++++++++++ modules/user/user.test | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'modules/user') diff --git a/modules/user/user.install b/modules/user/user.install index 00afd2dc0..9d5256e62 100644 --- a/modules/user/user.install +++ b/modules/user/user.install @@ -823,6 +823,20 @@ function user_update_7013(&$sandbox) { $sandbox['#finished'] = empty($sandbox['max']) || ($sandbox['progress'] / $sandbox['max']); } +/** + * Rename the 'post comments without approval' permission. + * + * In Drupal 7, this permission has been renamed to 'skip comment approval'. + */ +function user_update_7014() { + db_update('role_permission') + ->fields(array('permission' => 'skip comment approval')) + ->condition('permission', 'post comments without approval') + ->execute(); + + return t("Renamed the 'post comments without approval' permission to 'skip comment approval'."); +} + /** * @} End of "defgroup user-updates-6.x-to-7.x" * The next series of updates should start at 8000. diff --git a/modules/user/user.test b/modules/user/user.test index cbde24b71..91549f0de 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -571,7 +571,7 @@ class UserCancelTestCase extends DrupalWebTestCase { variable_set('user_cancel_method', 'user_cancel_delete'); // Create a user. - $account = $this->drupalCreateUser(array('cancel account', 'post comments', 'post comments without approval')); + $account = $this->drupalCreateUser(array('cancel account', 'post comments', 'skip comment approval')); $this->drupalLogin($account); // Load real user object. $account = user_load($account->uid, TRUE); -- cgit v1.2.3