From 86bab2e9a66ff5aeecf22f77cd5a08af171e0dd3 Mon Sep 17 00:00:00 2001 From: christian Date: Mon, 2 Oct 2023 10:33:27 -0500 Subject: [PATCH] Course: Allow access to course when visibility is for registered users - refs BT#21080 --- src/CoreBundle/Security/Authorization/Voter/CourseVoter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php b/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php index 56f67a21b6..4783b7f260 100644 --- a/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php +++ b/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php @@ -81,7 +81,7 @@ class CourseVoter extends Voter } // If user is logged in and is open platform, allow access. - if (Course::OPEN_PLATFORM === $course->getVisibility()) { + if (in_array($course->getVisibility(), [Course::OPEN_PLATFORM, Course::REGISTERED])) { $user->addRole(ResourceNodeVoter::ROLE_CURRENT_COURSE_STUDENT); if ($course->hasUserAsTeacher($user)) {