Skip to content

Instantly share code, notes, and snippets.

@martsie
Created January 25, 2017 10:15
Show Gist options
  • Save martsie/869dc26daf030753d0abb10c80cbeeee to your computer and use it in GitHub Desktop.
Save martsie/869dc26daf030753d0abb10c80cbeeee to your computer and use it in GitHub Desktop.
Example implementation of Drupal 7 hook_permission
<?php
/**
* Implements hook_permission().
*
* Defines a new permission called 'my custom permission'.
*/
function my_custom_module_permission() {
return array(
'my custom permission' => array(
'title' => t('My custom permission'),
'description' => t('Allows users to perform a task in my module.'),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment