Skip to content
Snippets Groups Projects
Commit 178c7246 authored by Otto Visser's avatar Otto Visser
Browse files

Merge branch '303-manager-cannot-update-student-assistant' into 'development'

Resolve "Manager cannot update student/assistant"

Closes #303

See merge request !385
parents 2faa3342 3eba2519
Branches
Tags
2 merge requests!387Development,!385Resolve "Manager cannot update student/assistant"
......@@ -102,14 +102,14 @@ public class PermissionService {
public boolean canUpdateParticipant(Object principal, Long courseId, Long participantId) {
User user = getUser(principal);
User participant = getRole(participantId).getUser();
Role participantRole = getRole(participantId);
Course course = courseRepository.findByIdOrThrow(courseId);
return user.isAdmin() ||
user.teaches(course) ||
user.manages(course) && !participant.teaches(course) ||
participant.getId().equals(user.getId());
user.manages(course) && !(participantRole instanceof Teacher) ||
participantRole.getUser().getId().equals(user.getId());
}
public boolean canAddParticipant(Object principal, Long courseId, String participantRole) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment