| Versionen | |
|---|---|
| drupal6 – drupal7 | 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.
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.
developer-docs/
<?php
function hook_perm() {
return array('administer my module');
}
?>
Kommentare
Kommentar hinzufügen