You are here

function forum_access_update_1 in Forum Access 6

Same name and namespace in other branches
  1. 5 forum_access.install \forum_access_update_1()

Purge orphaned grants that were left behind when deleting roles.

File

./forum_access.install, line 162
Install, update and uninstall functions for the forum_access module.

Code

function forum_access_update_1() {
  $ret = array();
  $ret[] = update_sql("DELETE FROM {forum_access} WHERE rid NOT IN (SELECT rid from {role})");
  $ret[] = update_sql("DELETE FROM {node_access} WHERE realm = 'forum_access' AND gid NOT IN (SELECT rid from {role})");
  return $ret;
}