function hook_perm

You are here

4.6 core.php hook_perm()
4.7 core.php 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()

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

aggregator_perm in modules/aggregator.module
Implementation of hook_perm().
block_perm in modules/block.module
Implementation of hook_perm().
blog_perm in modules/blog.module
Implementation of hook_perm().
book_perm in modules/book.module
Implementation of hook_perm().
comment_perm in modules/comment.module
Implementation of hook_perm().

... See full list

1 invocation of hook_perm()
user_admin_perm in modules/user.module
Menu callback: administer permissions.

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');
}