Community Documentation

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()

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().
fileupload_perm in developer/examples/fileupload.module
Implementation of hook_perm.
filter_perm in modules/filter.module
Implementation of hook_perm().
forum_perm in modules/forum.module
Implementation of hook_perm().
locale_perm in modules/locale.module
Implementation of hook_perm().
menu_perm in modules/menu.module
Implementation of hook_perm().
node_access_example_perm in developer/examples/node_access_example.module
Implementation of hook_perm().
node_example_perm in developer/examples/node_example.module
Implementation of hook_perm().
node_perm in modules/node.module
Implementation of hook_perm().
page_example_perm in developer/examples/page_example.module
Implementation of hook_perm().
page_perm in modules/page.module
Implementation of hook_perm().
path_perm in modules/path.module
Implementation of hook_perm().
poll_perm in modules/poll.module
Implementation of hook_perm().
search_perm in modules/search.module
Implementation of hook_perm().
statistics_perm in modules/statistics.module
Implementation of hook_perm().
story_perm in modules/story.module
Implementation of hook_perm().
system_perm in modules/system.module
Implementation of hook_perm().
taxonomy_perm in modules/taxonomy.module
Implementation of hook_perm().
theme_user_admin_perm in modules/user.module
upload_perm in modules/upload.module
Implementation of hook_perm().
user_admin_perm in modules/user.module
Menu callback: administer permissions.
user_perm in modules/user.module
Implementation of hook_perm().

File

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

Code

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