problem in define userrole

problem in define userrole

by madhan ponnusamy -
Number of replies: 0
Hi,
I have little problem with define UserRole, the problem is

Though i set the option View hidden activities (moodle/course:viewhiddenactivities):Allow
for the user role there is no effect in the course.

If the user having the role navigates the course. it's showing the message
"Sorry, this activity is currently hidden".
Then i changed the code in the moodle/mod/scrom/view.php by changing the code...

if (empty($cm->visible) and !has_capability('moodle/course:manageactivities', $context)) {
notice(get_string("activityiscurrentlyhidden"));
}

to

if (empty($cm->visible) and !has_capability('moodle/course:viewhiddenactivities', $context)) {
notice(get_string("activityiscurrentlyhidden"));
}


its working fine....is this the right way to proceed...or is there any other way to work it out


Average of ratings: -