You are here

function taxonomy_permissions_disable in Taxonomy Permissions 7

File

./taxonomy_permissions.install, line 27
Install, update and uninstall functions for the taxonomy_permissions module.

Code

function taxonomy_permissions_disable() {

  // Re-register taxonomy.module's permissions under its own name to keep them
  // from being purged in case we're uninstalled.
  taxonomy_permissions_disabling(TRUE);
  module_implements('permission', FALSE, TRUE);
  cache_clear_all('module_implements', 'cache_bootstrap');
  $modules = user_permission_get_modules();
  $perms = user_role_permissions(user_roles());
  foreach ($perms as $rid => $perm) {
    foreach (array_keys($perm) as $p) {
      if (!isset($modules[$p]) || $modules[$p] != 'taxonomy') {
        unset($perm[$p]);
      }
    }
    user_role_change_permissions($rid, $perm);
  }
}