mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
changing CONTEXT_GROUP to CONTEXT_COURSE for calendar:manageentries capability
This commit is contained in:
parent
3f7d592598
commit
d142077ef1
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue