You are here

acl.install in ACL 8

Same filename and directory in other branches
  1. 5 acl.install
  2. 6 acl.install
  3. 7 acl.install

Install, update and uninstall functions for the acl module.

File

acl.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the acl module.
 */

/**
 * Implements hook_schema().
 */
function acl_schema() {
  $schema['acl'] = array(
    'description' => 'The base Access Control Lists table.',
    'fields' => array(
      'acl_id' => array(
        'description' => 'Primary key: unique ACL ID.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'module' => array(
        'description' => 'The name of the module that created this ACL entry.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'A name (or other identifying information) for this ACL entry, given by the module that created it.',
        'type' => 'varchar',
        'length' => 255,
      ),
      'figure' => array(
        'description' => "A number for this ACL entry, given by the module that created it; use either 'name' or 'figure'.",
        'type' => 'int',
      ),
    ),
    'primary key' => array(
      'acl_id',
    ),
    'indexes' => array(
      'module_figure_name' => array(
        array(
          'module',
          64,
        ),
        'figure',
        array(
          'name',
          64,
        ),
      ),
      'module_name' => array(
        array(
          'module',
          64,
        ),
        'name',
      ),
    ),
  );
  $schema['acl_user'] = array(
    'description' => 'Identifies {users} to which the referenced {acl} entry applies.',
    'fields' => array(
      'acl_id' => array(
        'description' => 'The {acl}.acl_id of the entry.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The {user}.uid to which this {acl} entry applies.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'acl_id',
      'uid',
    ),
    'indexes' => array(
      'uid' => array(
        'uid',
      ),
    ),
  );
  $schema['acl_node'] = array(
    'description' => 'Identifies {node}s to which the referenced {acl} entry applies and defines the permissions granted.',
    'fields' => array(
      'acl_id' => array(
        'description' => 'The {acl}.acl_id of the entry.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => 'The {node}.nid to grant permissions for.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'grant_view' => array(
        'description' => 'Whether to grant "view" permission.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'grant_update' => array(
        'description' => 'Whether to grant "update" permission.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'grant_delete' => array(
        'description' => 'Whether to grant "delete" permission.',
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'priority' => array(
        'description' => 'The priority of this grant record (for hook_node_access_records()).',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'acl_id',
      'nid',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
acl_schema Implements hook_schema().