Browse Source

Anons can access course (depends of course visibility)

jmontoyaa 8 years ago
parent
commit
e070396324

+ 4 - 3
src/Chamilo/CoreBundle/Security/Authorization/Voter/CourseVoter.php

@@ -81,10 +81,11 @@ class CourseVoter extends AbstractVoter
      */
     protected function isGranted($attribute, $course, $user = null)
     {
-        // make sure there is a user object (i.e. that the user is logged in)
-        if (!$user instanceof UserInterface) {
+        // Make sure there is a user object (i.e. that the user is logged in)
+        // Anons can enter a course depending of the course visibility
+        /*if (!$user instanceof UserInterface) {
             return false;
-        }
+        }*/
 
         $authChecker = $this->container->get('security.authorization_checker');