When a teacher is grading an assignment, there is an option in the top right to filter by “Submitted”, “Not submitted”, “Requires Grading” etc. Selecting one of these filter options triggers an ajax request to set the "assign_filter" preference before actually retrieving the filtered student submissions. If the ‘moodle/user:editownprofile’ capability is not set or not allowed for teachers, this results in a “nopermission” error. Since the filtering of student submissions depends on the user preference value being set, the filtering fails and instead it returns all (unfiltered) student submissions. The editownprofile capability should not prevent a teacher from being able to filter while grading.