private CommandProcessingResult updateGroupingType(final Long groupId, final JsonCommand command, final GroupTypes groupingType) {
try {
this.context.authenticatedUser();
final Group groupForUpdate = this.groupRepository.findOneWithNotFoundDetection(groupId);
final Long officeId = groupForUpdate.officeId();
final Office groupOffice = groupForUpdate.getOffice();
final String groupHierarchy = groupOffice.getHierarchy();
this.context.validateAccessRights(groupHierarchy);