You are here

function _tac_fields_disable_role in Taxonomy Access Control 6

Helper function to delete all access rules for a field/row pair.

Parameters

$field: The machine name of the field.

$rid: The role id for which to remove access rules for the field.

1 call to _tac_fields_disable_role()
tac_fields_delete in tac_fields/tac_fields.admin.inc

File

tac_fields/tac_fields.admin.inc, line 245
Administrative interface for TAC Fields.

Code

function _tac_fields_disable_role($field, $rid) {

  // Remove all records for the role/field pair from the database.
  db_query("DELETE FROM {term_field_access} \n     WHERE field = '%s' AND rid = %d", $field, $rid);
  db_query("DELETE FROM {term_field_access_defaults} \n     WHERE field = '%s' AND rid = %d", $field, $rid);
  drupal_set_message(t('All term access rules for field %field and role %rid have been deleted.', array(
    '%field' => $field,
    '%rid' => $rid,
  )));
  drupal_goto('admin/user/tac_fields');
}