Merge pull request #4910 from christianbeeznest/ofaj-21080

Course: Allow access to course when visibility is for registered users - refs BT#21080
pull/4912/head
christianbeeznest 1 year ago committed by GitHub
commit 907266f2af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      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)) {

Loading…
Cancel
Save