function comments_can_access_comments
Search API
6.x comments.module | comments_can_access_comments() |
4.x comments.module | comments_can_access_comments() |
5.x comments.module | comments_can_access_comments() |
Used by the menu to determine if the comments tab should appear.
File
- modules/
comments/ comments.module, line 121
Code
function comments_can_access_comments() {
global $current_student_id, $user;
// must be logged in first...
if (!user_has_permission("access_logged_in_content")) {
return FALSE;
}
// Do they have the correct permission to view comments?
if (!user_has_permission("view_comments")) {
return FALSE;
}
if ($current_student_id != "") {
return TRUE;
}
return FALSE;
}