If a student or teacher have got the permission to edit the content of a folder ressource (mod/folder:managefiles), the edit button does not appear in the view if the folder content is dispayed inline on the course page.
Presumed reproduction steps
- as teacher or manager, go to a course
- turn editing on
- insert a folder ressource to the course, set "Display folder contents" to "Inline on a course page"
- enrol a student to the course
- for that folder, click edit → assign roles
- click role teacher and add the previously added student to this teacher role
- log out and log in as student
- scroll to the folder ressource and your cannot see a edit button even if you have the permission to edit (mod/folder:managefiles)
As I figured out the problem is the check on (moodle/course:manageactivities) for inline folder ressources.
So if you have the capability (moodle/course:manageactivities and mod/folder:managefiles)
of a single inline folder ressourse activity you have no way to edit the content.
One Solution might be to remove the line of these checks on Line 84 in mod/folder/renderer.php:
// Display the "Edit" button if current user can edit folder contents.
// Do not display it on the course page for the teachers because there
// is an "Edit settings" button right next to it with the same functionality.
if (has_capability('mod/folder:managefiles', $context) &&
($folder>display != FOLDER_DISPLAY_INLINE || !has_capability('moodle/course:manageactivities', $context)))- {
$editbutton = $this->output->single_button(
new moodle_url('/mod/folder/edit.php', array('id' => $cm->id)),
get_string('edit')
);
$buttons .= $editbutton;
}
- blocks
-
MDL-56841 Folder: Buttons to edit and download folder are not shown when folder is displayed on the course page
- Closed