You are here

vppn.install in View Permission Per Node 7

Installation for the VPPN module.

File

vppn.install
View source
<?php

/**
 * @file
 * Installation for the VPPN module.
 */

/**
 * Implements hook_schema().
 */
function vppn_schema() {

  // The main VPPN table.
  $schema['vppn'] = array(
    'description' => 'Role view permissions per node.',
    'fields' => array(
      'nid' => array(
        'description' => 'The primary identifier for a node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'rid' => array(
        'description' => 'The role id that has the view permission.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'nid',
      'rid',
    ),
  );

  // Return the database table schema definition.
  return $schema;
}

/**
 * Implements hook_uninstall().
 */
function vppn_uninstall() {

  // Delete any defined variables.
  db_delete('variable')
    ->condition('name', 'vppn_node_%', 'LIKE')
    ->execute();
}

Functions

Namesort descending Description
vppn_schema Implements hook_schema().
vppn_uninstall Implements hook_uninstall().