return baseRight;
}
public BaseRight updateBaseRightNamePriorityDefaultAllowed(long baseRightID, String baseRightName, int priority,
boolean defaultIsAllowed) throws DuplicateNameException {
BaseRight baseRight = dbHandler.getBaseRight(baseRightID);
if (baseRight.getRightDescription().equals(baseRightName)) {
return baseRight;
}
if (baseRight.getGroup().getBaseRight(baseRightName) != null) {
throw new DuplicateNameException("Right name can't be duplicate", DuplicateNameType.DuplicateRightName);
}
baseRight.setRightDescription(baseRightName);
baseRight.setPriority(priority);
baseRight.setDefaultIsAllowed(defaultIsAllowed);
dbHandler.upsertBaseRight(baseRight);
return baseRight;
}