Skip to content

Instantly share code, notes, and snippets.

@sobi3ch
Created May 5, 2011 00:12
Show Gist options
  • Save sobi3ch/956292 to your computer and use it in GitHub Desktop.
Save sobi3ch/956292 to your computer and use it in GitHub Desktop.
helper function in template or module
<?php
function user_is_editor() {
global $user;
if(in_array(array('employee editor', 'administrator'), $user->roles) || $user->uid == 1) {
return TRUE;
} else {
return FALSE;
}
}
@sobi3ch
Copy link
Author

sobi3ch commented May 5, 2011

in array put your roles that have appropriately roles to be editor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment