You are here

function ad_ui_add_any_access in Advertisement 7.2

Access callback: determine if the user can create any type of ad.

1 string reference to 'ad_ui_add_any_access'
ad_ui_menu in ./ad_ui.module
Implements hook_menu().

File

./ad_ui.module, line 111

Code

function ad_ui_add_any_access() {

  // Grant automatic access to users with administer advertisement types access.
  if (user_access('administer advertisement types')) {
    return TRUE;
  }

  // Check the user's access on an ad type basis.
  foreach (ad_types() as $type => $ad_type) {
    if (ad_ui_add_access($type)) {
      return TRUE;
    }
  }
  return FALSE;
}