You are here

function workspace_access in Workspace 7

Same name and namespace in other branches
  1. 6 workspace.module \workspace_access()

Menu access callback.

1 call to workspace_access()
workspace_user_view in ./workspace.module
Implements hook_user_view().
1 string reference to 'workspace_access'
workspace_menu in ./workspace.module
Implements hook_menu().

File

./workspace.module, line 133
Presents a user-centric view of content.

Code

function workspace_access($account, $module_enabled = TRUE) {
  global $user;

  // Let admin see $account
  if ($user->uid == 1 && $account->uid > 1) {
    return user_access('access content', $account) && user_access('access workspace', $account) && $module_enabled;
  }
  return user_access('access content', $user) && user_access('access workspace', $user) && (user_access('view all workspaces', $user) || $user->uid == $account->uid && $user->uid != 0) && $module_enabled;

  // If, e.g., comment module is disabled, remove comment local task.
}