You are here

function acl_create_acl in ACL 7

Same name and namespace in other branches
  1. 8 acl.module \acl_create_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.

4 calls to acl_create_acl()
AclWebTestCase::testNodeAclAddRemoveFromNode in tests/acl.test
Includes acl_node_add_acl, acl_node_remove_acl, acl_node_clear_acls
AclWebTestCase::testNodeAclCreateDelete in tests/acl.test
Includes acl_create_acl, acl_delete_acl, acl_get_id_by_name
AclWebTestCase::testNodeAclSingleUserAddRemove in tests/acl.test
Includes acl_add_user, acl_remove_user, acl_has_users, acl_get_id_by_name, acl_has_user, acl_get_uids
acl_create_new_acl in ./acl.module
Create a new ACL (obsolete).

File

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

Code

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