You are here

function acl_schema in ACL 6

Same name and namespace in other branches
  1. 8 acl.install \acl_schema()
  2. 7 acl.install \acl_schema()

Implementation of hook_schema().

File

./acl.install, line 18
Install, update and uninstall functions for the acl module.

Code

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,
      ),
      'number' => array(
        'description' => "A number for this ACL entry, given by the module that created it; use either 'name' or 'number'.",
        'type' => 'int',
      ),
    ),
    'primary key' => array(
      'acl_id',
    ),
    'indexes' => array(
      'module_name_number' => array(
        array(
          'module',
          64,
        ),
        array(
          'name',
          64,
        ),
        'number',
      ),
      'module_number' => array(
        array(
          'module',
          64,
        ),
        'number',
      ),
    ),
  );
  $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;
}