mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
changing CONTEXT_GROUP to CONTEXT_COURSE for calendar:manageentries capability
This commit is contained in:
parent
3f7d592598
commit
d142077ef1
@ -626,8 +626,9 @@ function calendar_add_event_allowed($event) {
|
||||
// to edit group calendar too
|
||||
// there is no need to check membership, because if you have this capability
|
||||
// you will have a role in this group context
|
||||
return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_GROUP, $event->groupid));
|
||||
|
||||
$group = get_record('groups', 'id', $event->groupid);
|
||||
//return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_GROUP, $event->groupid));
|
||||
return has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_COURSE, $group->courseid));
|
||||
case 'user':
|
||||
if ($event->userid == $USER->id) {
|
||||
return (has_capability('moodle/calendar:manageownentries', $sitecontext));
|
||||
|
Loading…
x
Reference in New Issue
Block a user