@Override public boolean removeTeamMember(String projectIdentifier, ProjectTeamMember member) throws NoSuchEntityException, ValidationFailedException { setTenancyContext(projectIdentifier); com.tasktop.c2c.server.profile.domain.internal.Project project; try { project = profileService.getProjectByIdentifier(projectIdentifier); } catch (EntityNotFoundException e) { handle(e); throw new IllegalStateException(); } try { profileService.removeProjectProfile(project.getId(), member.getProfile().getId()); } catch (EntityNotFoundException e) { handle(e); throw new IllegalStateException(); } catch (ValidationException e) { handle(e); throw new IllegalStateException(); } return true; }
@Override public Boolean updateTeamMemberRoles(String projectIdentifier, ProjectTeamMember member) throws NoSuchEntityException, ValidationFailedException { setTenancyContext(projectIdentifier); try { com.tasktop.c2c.server.profile.domain.internal.Project project = profileService.getProjectByIdentifier(projectIdentifier); ProjectProfile projectProfile = profileService.getProjectProfile(project.getId(), member.getProfile().getId()); // Wire in our updated roles now. projectProfile.setOwner(member.getRoles().contains(ProjectRole.OWNER)); projectProfile.setUser(member.getRoles().contains(ProjectRole.MEMBER)); profileService.updateProjectProfile(projectProfile); } catch (EntityNotFoundException e) { handle(e); } catch (ValidationException e) { handle(e); } return true; }