class UserRevokeSuperAdminRightsService {

	@Validated
	@UseCaseAdministratorRevokesAdminRightsFromAdmin(
			@Step(
					number = 2,
					name = "Service revokes user admin rights.",
					next = { 3,	4 },
					description = "The service will revoke user admin righs and triggers asynchronous events"))
	/* @formatter:on */
	public void revokeSuperAdminRightsFrom(String userId) {
		String sanitizedLogUserId = logSanitizer.sanitize(userId,30);
		auditLogService.log("Triggered revoking admin rights from user {}",sanitizedLogUserId);

		assertion.isValidUserId(userId);

		User user = userRepository.findOrFailUser(userId);

		if (!user.isSuperAdmin()) {
			LOG.info("User:{} was already no super administrator, so just ignored",sanitizedLogUserId);
			return;
		}
		assertNotLastSuperAdmin();

		user.superAdmin=false;
		userRepository.save(user);

		requestUserRoleRecalculaton(user);
		informUserNoLongerSuperadmin(user);

	}

}