소스 검색

Allow anonymous user when enter "open to world" courses

jmontoyaa 8 년 전
부모
커밋
b2bf11535b
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      src/Chamilo/CoreBundle/Security/Authorization/Voter/CourseVoter.php

+ 5 - 0
src/Chamilo/CoreBundle/Security/Authorization/Voter/CourseVoter.php

@@ -109,6 +109,11 @@ class CourseVoter extends AbstractVoter
                     return true;
                 }
 
+                // Other course visibility need to have a user set
+                if (!$user instanceof UserInterface) {
+                    return false;
+                }
+
                 // User is subscribed in the course no matter if is teacher/student
                 if ($course->hasUser($user)) {