You are here

function hook_access_scheme_insert in Access Control Kit 7

Responds to the creation of a new access scheme.

This hook is invoked from AccessSchemeEntityController::save() after the database query that will insert the scheme into the access_scheme table is scheduled for execution.

Note that when this hook is invoked, the changes have not yet been written to the database because a database transaction is still in progress. The transaction is not finalized until the save operation is entirely completed and the save() method goes out of scope. You should not rely on data in the database at this time, as it has not been updated yet. You should also note that any write/update database queries executed from this hook are also not committed immediately. Check AccessSchemeEntityController::save() and db_transaction() for more info.

Parameters

object $scheme: The access scheme that is being created.

1 function implements hook_access_scheme_insert()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

access_access_scheme_insert in ./access.access.inc
Implements hook_access_scheme_insert().

File

./access.api.php, line 277
Hooks provided by the access control kit module.

Code

function hook_access_scheme_insert($scheme) {

  // Create a variable to indicate that access grants should be audited whenever
  // the scheme configuration changes.
  variable_set('access_audit_' . $scheme->machine_name, FALSE);
}