1 menu_example.module menu_example_custom_access($role_name)

Determine whether the current user has the role specified.

Parameters

string $role_name: The role required for access

Return value

bool True if the acting user has the role specified.

Related topics

File

modules/examples/menu_example/menu_example.module, line 383
Module file for menu_example.

Code

function menu_example_custom_access($role_name) {
  $access_granted = in_array($role_name, $GLOBALS['user']->roles);
  return $access_granted;
}