hook_perm

5 core.php hook_perm()
6 core.php hook_perm()

Define user permissions.

This hook can supply permissions that the module defines, so that they can be selected on the user permissions page and used to restrict access to actions the module performs.

Return value

An array of permissions strings.

Permissions are checked using user_access().

For a detailed usage example, see page_example.module.

Related topics

26 functions implement hook_perm()

1 invocation of hook_perm()

File

developer/hooks/core.php, line 764
These are the hooks that are invoked by the Drupal core.

Code

function hook_perm() {
  return array('administer my module');
}
Login or register to post comments