From a409588bc05f61dc4231da15505af760700d1e7b Mon Sep 17 00:00:00 2001 From: Nosolored Date: Fri, 13 Mar 2020 09:08:14 +0100 Subject: [PATCH] Access to dhr in task view --- main/work/view.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/work/view.php b/main/work/view.php index 4fa72dd2ff..762fa40718 100755 --- a/main/work/view.php +++ b/main/work/view.php @@ -41,7 +41,10 @@ $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh( $courseInfo ); -if ((user_is_author($id) || $isDrhOfCourse || (api_is_allowed_to_edit() || api_is_coach())) || +$sessionId = (int) $_GET['id_session']; +$isDrhOfSession = !empty(SessionManager::getSessionFollowedByDrh(api_get_user_id(), $sessionId)); + +if ((user_is_author($id) || $isDrhOfCourse || $isDrhOfSession || (api_is_allowed_to_edit() || api_is_coach())) || ( $courseInfo['show_score'] == 0 && $work['active'] == 1 && @@ -64,7 +67,7 @@ if ((user_is_author($id) || $isDrhOfCourse || (api_is_allowed_to_edit() || api_i $work['active'] == 1 && $work['accepted'] == 1 ) || - (api_is_allowed_to_edit() || api_is_coach()) || user_is_author($id) || $isDrhOfCourse + (api_is_allowed_to_edit() || api_is_coach()) || user_is_author($id) || $isDrhOfCourse || $isDrhOfSession ) { $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null; $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : null;