You are here

function acl_create_new_acl in ACL 6

Same name and namespace in other branches
  1. 5 acl.module \acl_create_new_acl()
  2. 7 acl.module \acl_create_new_acl()

Create a new ACL.

The client module will have to keep track of the ACL. For that it can assign either a $name or a $number to this ACL.

Parameters

$module: The name of the client module.

$name: An arbitrary name for this ACL, freely defined by the client module.

$number: An arbitrary number for this ACL, freely defined by the client module.

Return value

The ID of the newly created ACL.

File

./acl.module, line 28
An API module providing by-user access control lists.

Code

function acl_create_new_acl($module, $name = NULL, $number = NULL) {
  $acl = array(
    'module' => $module,
    'name' => $name,
    'number' => $number,
  );
  drupal_write_record('acl', $acl);
  return $acl['acl_id'];
}