You are here

function field_permissions_field_delete_field in Field Permissions 7

Implements hook_field_delete_field().

File

./field_permissions.module, line 337
This is the main script for the Field Permissions module. It merely contains the implementation of hooks invoked by Drupal core and CCK. All common functions are externalized into several scripts that are included on demand to save memory consumption…

Code

function field_permissions_field_delete_field($field) {

  // Delete any permissions related to the deleted field.
  $all_permissions = array_keys(field_permissions_permission());
  if (!empty($all_permissions)) {
    db_delete('role_permission')
      ->condition('module', 'field_permissions')
      ->condition('permission', $all_permissions, 'NOT IN')
      ->execute();
  }
}