hook_perm

Definition

hook_perm()
developer/hooks/core.php, line 718

Description

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.

Permissions are checked using user_access().

For a detailed usage example, see page_example.module.

Return value

An array of permissions strings.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function hook_perm() {
  return array('administer my module');
}
?>
 
 

Drupal is a registered trademark of Dries Buytaert.