@Override public void validateModifiedRoleService( SecurityRoleServiceConfig config, SecurityRoleServiceConfig oldConfig) throws SecurityConfigException { super.validateModifiedRoleService(config, oldConfig); XMLRoleServiceConfig old = (XMLRoleServiceConfig) oldConfig; XMLRoleServiceConfig modified = (XMLRoleServiceConfig) config; if (old.getFileName().equals(modified.getFileName()) == false) throw createSecurityException( FILENAME_CHANGE_INVALID_$2, old.getFileName(), modified.getFileName()); }
/** Saves/persists a role service configuration. */ public void saveRoleService(SecurityRoleServiceConfig config) throws IOException, SecurityConfigException { SecurityConfigValidator validator = SecurityConfigValidator.getConfigurationValiator( GeoServerRoleService.class, config.getClassName()); if (config.getId() == null) { config.initBeforeSave(); validator.validateAddRoleService(config); } else { validator.validateModifiedRoleService( config, roleServiceHelper.loadConfig(config.getName())); } roleServiceHelper.saveConfig(config); // remove from cache roleServices.remove(config.getName()); // update active role service if (activeRoleService != null && config.getName().equals(activeRoleService.getName())) { synchronized (activeRoleService) { activeRoleService.initializeFromConfig(config); } } }
GeoServerRole.ADMIN_ROLE.getAuthority()); try { validator.validateModifiedRoleService(config, config); fail("unknown role service should fail"); } catch (SecurityConfigException ex) {