function workspace_access in Workspace 6
Same name and namespace in other branches
- 7 workspace.module \workspace_access()
Menu access callback.
1 call to workspace_access()
- workspace_user in ./
workspace.module - Implementation of hook_user().
1 string reference to 'workspace_access'
- workspace_menu in ./
workspace.module - Implementation of hook_menu().
File
- ./
workspace.module, line 100 - 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.
}