From 89b0570d707e7a895a832f877dcdc74b68d26d42 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 11 Oct 2008 18:29:20 +0000 Subject: #305566 by agentrickard and moshe weitzman: Split 'bypass node access' from 'administer nodes'. --- modules/system/system.install | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'modules/system/system.install') diff --git a/modules/system/system.install b/modules/system/system.install index cbdc52ff8..3a5904dfd 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -3047,6 +3047,29 @@ function system_update_7010() { return $ret; } +/** + * Split the 'bypass node access' permission from 'administer nodes'. + */ +function system_update_7011() { + $ret = array(); + // Get existing roles that can 'administer nodes'. + $rids = array(); + $rids = db_query("SELECT rid FROM {role_permission} WHERE permission = :perm", array(':perm' => 'administer nodes'))->fetchCol(); + // None found. + if (empty($rids)) { + return $ret; + } + $insert = db_insert('role_permission')->fields(array('rid', 'permission')); + foreach ($rids as $rid) { + $insert->values(array( + 'rid' => $rid, + 'permission' => 'bypass node access', + )); + } + $insert->execute(); + return $ret; +} + /** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. -- cgit v1.2.3