acb.install in Access Control Bridge 7
Same filename and directory in other branches
Installation file containing install hooks.
File
acb.installView source
<?php
/**
* @file Installation file containing install hooks.
*/
/**
* Implements hook_enable().
*/
function acb_enable() {
// Ask for rebuilding node permissions.
node_access_needs_rebuild(TRUE);
// Inform users of a change compared to previous versions.
$perms = user_role_permissions(array(
DRUPAL_AUTHENTICATED_RID => DRUPAL_AUTHENTICATED_RID,
));
if (module_exists('domain') && in_array('edit domain content', $perms[DRUPAL_AUTHENTICATED_RID])) {
drupal_set_message(t('Notice for <strong>if you updated from Access Control Bridge 7.x-1.1 or below</strong>: the "%edit" and "%delete" permissions aren\'t required anymore. It is recommended to uncheck them if you don\'t actually use them for your permission setup and <strong>rebuild your permissions</strong> afterwards.', array(
'%edit' => t('Edit any content on assigned domains'),
'%delete' => t('Delete any content on assigned domains'),
)), 'warning');
}
}
/**
* Implements hook_disable().
*/
function acb_disable() {
// Ask for rebuilding node permissions.
node_access_needs_rebuild(TRUE);
}
/**
* Implements hook_install().
*/
function acb_install() {
// Set module weight to ensure its hooks are called last.
db_update('system')
->fields(array(
'weight' => 500,
))
->condition('name', 'acb')
->execute();
}
Functions
Name | Description |
---|---|
acb_disable | Implements hook_disable(). |
acb_enable | Implements hook_enable(). |
acb_install | Implements hook_install(). |