Merge branch 'MDL-77645-401' of https://github.com/paulholden/moodle into MOODLE_401_STABLE

This commit is contained in:
Andrew Nicols
2023-07-20 00:11:59 +08:00
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -3751,7 +3751,7 @@ function core_course_drawer(): string {
}
// Show course index to users can access the course only.
if (!can_access_course($PAGE->course)) {
if (!can_access_course($PAGE->course, null, '', true)) {
return '';
}
@@ -102,3 +102,11 @@ Feature: Restricting access to course lists
And I follow "Biology Y1"
And I should see "You cannot enrol yourself in this course."
And I log out
@javascript
Scenario: Browse courses as a user who has a disabled enrolment in them
Given the following "course enrolments" exist:
| user | course | role | status |
| usere | ENG1 | student | 1 |
When I am on the "ENG1" course page logged in as usere
Then I should see "You cannot enrol yourself in this course."