From a538cd4b409227cca774a0da5952441202bc13b9 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Wed, 7 Mar 2012 11:28:57 +0100
Subject: [PATCH] OO-160: coach haven't to see all users with assessment but
 only the user they coach

--HG--
branch : 80-patch
---
 .../course/assessment/AssessmentMainController.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/olat/course/assessment/AssessmentMainController.java b/src/main/java/org/olat/course/assessment/AssessmentMainController.java
index b51be9f1c32..00244533921 100644
--- a/src/main/java/org/olat/course/assessment/AssessmentMainController.java
+++ b/src/main/java/org/olat/course/assessment/AssessmentMainController.java
@@ -609,10 +609,12 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea
 		BaseSecurity secMgr = BaseSecurityManager.getInstance();
 		List<Identity> usersList = secMgr.getIdentitiesOfSecurityGroups(secGroups);
 
-		ICourse course = CourseFactory.loadCourse(ores);
-		CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager();
-		List<Identity> assessedRsers = pm.getAllIdentitiesWithCourseAssessmentData(usersList);
-		usersList.addAll(assessedRsers);
+		if(callback.mayViewAllUsersAssessments()) {
+			ICourse course = CourseFactory.loadCourse(ores);
+			CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager();
+			List<Identity> assessedRsers = pm.getAllIdentitiesWithCourseAssessmentData(usersList);
+			usersList.addAll(assessedRsers);
+		}
 		return usersList;
 	}
 
-- 
GitLab