-
Bug
-
Resolution: Fixed
-
Minor
-
3.4.4
-
MOODLE_34_STABLE
-
MOODLE_34_STABLE, MOODLE_35_STABLE
-
If a user attempts to create an assignment and they do not have the 'moodle/calendar:manageentries' then the assignment is not created.
This seems incorrect as in this case it is not the user manipulating the calendar but the assignment activity itself.
Steps to reproduce
- Create a course and Prohibit the 'moodle/calendar:manageentries' capability for Teachers on it
- Enrol a user as a teacher on the course
- Login as the teacher
- Attempt to create an assignment
Outcome
Debug info:
Error code: nopermissiontoupdatecalendar
Stack trace:
- line 482 of \lib\setuplib.php: moodle_exception thrown
- line 448 of \calendar\lib.php: call to print_error()
- line 921 of \calendar\lib.php: call to calendar_event->update()
- line 1334 of \mod\assign\locallib.php: call to calendar_event::create()
- line 705 of \mod\assign\locallib.php: call to assign->update_calendar()
- line 41 of \mod\assign\lib.php: call to assign->add_instance()
- line 124 of \course\modlib.php: call to assign_add_instance()
- line 154 of \course\modedit.php: call to add_moduleinfo()
And no activity is created
Expected
An assignment will be created
Generally
In general, to add / modify an activity, the permissions checks will be done by the activity itself. When the activity creates or modifies the calendar events, the default for "unknown" event types is to check for moodle/calendar:manageentries on the context. The current user can have the capability to edit the activity settings, but not have the capability to manage the calendar events for the activity. This is now an unresolved conflicting state.
What needs to be decided is
- If a user can add or edit an activity, does that give them the capability to modify the events for that activity?
- Can they modify those events directly in the calendar (suggest "No")?
- If they can modify the events in the calendar, is that change reflected in the activity settings?
- In the calendar API what are the distinctions between API functions for allowing a user to modify activity events via the calendar UI or functions allowing a user to modify events by changing the activity settings?
Assignment is mentioned here, but the problem exists across all activity modules.
- has a non-specific relationship to
-
MDL-79857 restore_backup.php doesn't set $USER in any way (should be the main admin) which can lead to permission problems
- Closed