You are here

function _user_dashboard_access in UserDashboard 7

Checks whether the current user is allowed to access the dashboard.

Parameters

object $account: the user account whose dashboard is being requested

Return value

bool FALSE if the user is not allowed to access the dashboard.

1 string reference to '_user_dashboard_access'
user_dashboard_menu in ./user_dashboard.module
Implements hook_menu().

File

./user_dashboard.module, line 781
The User Dashboard module forks Drupal 7's awesome Dashboard module to provide an individual dashboard for each user on the site.

Code

function _user_dashboard_access($account = NULL) {
  global $user;
  if (is_null($account)) {
    $account = $user;
  }
  if (!$user->uid || $account->uid != $user->uid && !user_access(USER_DASHBOARD_PERM_VIEW_ALL)) {
    return FALSE;
  }
  return TRUE;
}