Ver Fonte

Allow anonymous user when enter "open to world" courses

jmontoyaa há 8 anos atrás
pai
commit
b2bf11535b

+ 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)) {