function workbench_access_section_delete in Workbench Access 7
Delete an access section from the {workbench_access} table.
Also removes user access permissions from {workbench_access_user}.
Parameters
$section: The access scheme to delete. Follows the format of hook_workbench_access_info().
See also
hook_workbench_access_section_delete()
7 calls to workbench_access_section_delete()
- workbench_access_edit_form_submit in ./
workbench_access.module - Generic submit handler for adding sections to forms.
- workbench_access_menu_delete in modules/
menu.workbench_access.inc - Implements hook_menu_delete().
- workbench_access_menu_link_delete in modules/
menu.workbench_access.inc - Implements hook_menu_link_delete().
- workbench_access_rebuild_scheme in ./
workbench_access.module - Rebuild the section access tables.
- workbench_access_settings_submit in ./
workbench_access.admin.inc - Set configuration.
File
- ./
workbench_access.module, line 963 - Workbench Access module file.
Code
function workbench_access_section_delete($section) {
// Reset the tree.
workbench_access_reset_tree();
// Notify other modules.
module_invoke_all('workbench_access_delete', $section);
// Now clean up.
db_delete('workbench_access')
->condition('access_id', $section['access_id'])
->condition('access_scheme', $section['access_scheme'])
->execute();
db_delete('workbench_access_node')
->condition('access_id', $section['access_id'])
->condition('access_scheme', $section['access_scheme'])
->execute();
db_delete('workbench_access_user')
->condition('access_id', $section['access_id'])
->condition('access_scheme', $section['access_scheme'])
->execute();
db_delete('workbench_access_role')
->condition('access_id', $section['access_id'])
->condition('access_scheme', $section['access_scheme'])
->execute();
}