function hook_perm
6.x 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 grant or 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 permission strings. The strings must not be wrapped with the t() function, since the string extractor takes care of extracting permission names defined in the perm hook for translation.
Related topics
23 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 drupal-6.x/
modules/ aggregator/ aggregator.module - Implementation of hook_perm().
- block_perm in drupal-6.x/
modules/ block/ block.module - Implementation of hook_perm().
- blogapi_perm in drupal-6.x/
modules/ blogapi/ blogapi.module - Implementation of hook_perm().
- blog_perm in drupal-6.x/
modules/ blog/ blog.module - Implementation of hook_perm().
- book_perm in drupal-6.x/
modules/ book/ book.module - Implementation of hook_perm().
3 invocations of hook_perm()
- system_get_module_admin_tasks in drupal-6.x/
modules/ system/ system.module - Generate a list of tasks offered by a specified module.
- user_admin_perm in drupal-6.x/
modules/ user/ user.admin.inc - Menu callback: administer permissions.
- user_filters in drupal-6.x/
modules/ user/ user.module - List user administration filters that can be applied.
File
- documentation-6.x/
developer/ hooks/ core.php, line 1748 - These are the hooks that are invoked by the Drupal core.
Code
function hook_perm() {
return array('administer my module');
}