mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
made some changes so that if a user has any roles assigned in context_module or context_block with moodle/site:manageblocks or moodle/course:manageactivities, he will see the "turn editting on" button without needing to have a role assigned at context_course with moodle/course:manageactivies capability. Of course this user would not be able to edit any blocks or modules he/she is not supposed to edit. Ajax for these users with partial editing privilages are locked. Please report bugs asap as we are looking at backporting this change to 1.8. Cheers.
This commit is contained in:
parent
12ce9ea2ee
commit
217a8ee950
13 changed files with 149 additions and 62 deletions
|
@ -130,7 +130,7 @@
|
|||
|
||||
if ($USER->editing && !empty($USER->ajax) && !empty($CFG->enableajax) && $CFG->ajaxcapable) {
|
||||
|
||||
if (ajaxenabled()) {
|
||||
if (ajaxenabled() && has_capability('moodle/course:manageactivities', $context)) {
|
||||
|
||||
require_js(array('yui_yahoo',
|
||||
'yui_dom',
|
||||
|
@ -203,7 +203,7 @@
|
|||
|
||||
|
||||
// Use AJAX?
|
||||
if ($CFG->useajax) {
|
||||
if ($CFG->useajax && has_capability('moodle/course:manageactivities', $context)) {
|
||||
// At the bottom because we want to process sections and activities
|
||||
// after the relevant html has been generated. We're forced to do this
|
||||
// because of the way in which lib/ajax/ajaxcourse.js is written.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue