Created
January 25, 2017 10:18
-
-
Save martsie/c08b0c69cf2b48c47ca5a323f2a6369c to your computer and use it in GitHub Desktop.
A simple implementation of a core permission check in Drupal 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_init(). | |
* | |
* Runs every time a page is requested on the site. | |
*/ | |
function my_custom_module_init() { | |
if (user_access('access content')) { | |
drupal_set_message(t('User has Drupal core access content permission')); | |
} | |
else { | |
drupal_set_message(t('User does not have Drupal core access content permission')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment