Manager cannot update student/assistant

Summary

Whenever a manager tries to delete a student or assistant it does not work. The @permissionService canUpdateParticipant returns the right boolean value and it goes inside the method removeParticipant but roleRepository.delete(role) does not do anything.

Probable Causes

Whenever user.getRoles() gets called it does not work anymore. Teachers can delete users fine, but whenever a teacher just calls teacher.getRoles() and does not do anything with the value, the deletion will fail.

Possible Fix

It seems to be that user.getRoles() contains a side-effect where deletion from a repository does not work.

Steps to reproduce

  1. Log in as a manager
  2. Go to /course/[number]/participants
  3. Delete either a student, assistant or manager
  4. Methods are run, but no role is deleted from the repository
Edited Apr 28, 2020 by Thijs Nulle
Assignee Loading
Time tracking Loading