Skip to content

Instantly share code, notes, and snippets.

@matglas
Last active August 29, 2015 14:13
Show Gist options
  • Save matglas/90cd9e32596929fdad3f to your computer and use it in GitHub Desktop.
Save matglas/90cd9e32596929fdad3f to your computer and use it in GitHub Desktop.
Template for drupal permissions.
/**
* Implements hook_permission().
*/
function ZZMODULE_permission() {
$perms = array();
// Allow access to certain pages based on this permissions
$perms['administer XX'] = array(
'title' => t('Administer [ZZMODULE] settings'),
'description' => t('Administer the settings of [ZZMODULE].')
'restrict access' => FALSE
);
// Allow access to certain items for create, edit, delete.
$perms['administer XX [items]'] = array(
'title' => t('Administer [ZZMODULE] [items]'),
'description' => t('Administer [items] of [ZZMODULE].')
'restrict access' => FALSE
);
return $perms;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment