node_privacy_byrole.install in node privacy byrole 6
Same filename and directory in other branches
Install information for Node Privacy By Role.
File
node_privacy_byrole.installView source
<?php
/**
* @file
* Install information for Node Privacy By Role.
*/
/**
* Implementation of hook_schema().
*
* @return array
*/
function node_privacy_byrole_schema() {
return array(
'node_privacy_byrole' => array(
'fields' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'disp-width' => 10,
),
'gid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'disp-width' => 10,
),
'realm' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
'grant_view' => array(
'type' => 'int',
'unsigned' => TRUE,
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '3',
),
'grant_update' => array(
'type' => 'int',
'unsigned' => TRUE,
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '3',
),
'grant_delete' => array(
'type' => 'int',
'unsigned' => TRUE,
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '3',
),
),
'primary key' => array(
'nid',
'gid',
'realm',
),
),
);
return $schema;
}
/**
* Implementation of hook_install().
*/
function node_privacy_byrole_install() {
drupal_install_schema('node_privacy_byrole');
}
/**
* Implementation of hook_uninstall().
*/
function node_privacy_byrole_uninstall() {
drupal_uninstall_schema('node_privacy_byrole');
// Delete npbr variables holding defaults for content types.
db_query("DELETE FROM {variable} WHERE name LIKE 'npbr_default_%'");
variable_del('npbr_default_permissions');
drupal_set_message(t('TIP: If all your nodes say access denied, it may be necessary to !rebuild.', array(
'!rebuild' => l(t('rebuild permissions'), 'admin/content/node-settings'),
)));
}
/**
* Implementation of hook_enable()
*/
function node_privacy_byrole_enable() {
node_access_needs_rebuild();
}
/**
* Implementation of hook_disable()
*/
function node_privacy_byrole_disable() {
node_privacy_byrole_disabling(TRUE);
node_access_needs_rebuild();
}
Functions
Name![]() |
Description |
---|---|
node_privacy_byrole_disable | Implementation of hook_disable() |
node_privacy_byrole_enable | Implementation of hook_enable() |
node_privacy_byrole_install | Implementation of hook_install(). |
node_privacy_byrole_schema | Implementation of hook_schema(). |
node_privacy_byrole_uninstall | Implementation of hook_uninstall(). |