Rename exception OnwerCollabCannotChangeException

This commit is contained in:
Paulo Gustavo Veiga 2022-10-21 18:34:55 -07:00
parent c5009e8a07
commit 2981fe79f7
2 changed files with 5 additions and 5 deletions

View File

@ -20,13 +20,13 @@ package com.wisemapping.exceptions;
import org.jetbrains.annotations.NotNull;
public class CollabChangeException
public class OnwerCollabCannotChangeException
extends ClientException
{
private static final String MSG_KEY = "OWNER_ROLE_CAN_NOT_BE_CHANGED";
public CollabChangeException(@NotNull String email)
public OnwerCollabCannotChangeException(@NotNull String email)
{
super("Collab email can not be change. " + email + " is the the owner.",Severity.WARNING);
}

View File

@ -299,7 +299,7 @@ public class MindmapController extends BaseController {
@RequestMapping(method = RequestMethod.PUT, value = "/maps/{id}/collabs/", consumes = {"application/json"}, produces = {"application/json"})
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void addCollab(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException, AccessDeniedSecurityException, InvalidEmailException, TooManyInactiveAccountsExceptions, CollabChangeException {
public void addCollab(@PathVariable int id, @NotNull @RequestBody RestCollaborationList restCollabs) throws CollaborationException, MapCouldNotFoundException, AccessDeniedSecurityException, InvalidEmailException, TooManyInactiveAccountsExceptions, OnwerCollabCannotChangeException {
final Mindmap mindMap = findMindmapById(id);
// Only owner can change collaborators...
@ -346,12 +346,12 @@ public class MindmapController extends BaseController {
// Are we trying to change the owner ...
if (currentCollab != null && currentCollab.getRole() == CollaborationRole.OWNER) {
throw new CollabChangeException(collabEmail);
throw new OnwerCollabCannotChangeException(collabEmail);
}
// Role can not be changed ...
if (newRole == CollaborationRole.OWNER) {
throw new CollabChangeException(collabEmail);
throw new OnwerCollabCannotChangeException(collabEmail);
}
// This is collaboration that with different newRole, try to change it ...