@Override public boolean canCreateStore() { return delegate.canCreateStore(); }
public boolean canCreateStore() { return service.canCreateStore(); }
public boolean hasUserGroupStore(String name) { return getUserGroupService(name).canCreateStore(); }
public boolean hasUserGroupStore(String name) { return getUserGroupService(name).canCreateStore(); }
public boolean hasUserGroupStore(String name) { return getUserGroupService(name).canCreateStore(); }
protected GeoServerUserGroupStore getStore(String serviceName) throws IOException { GeoServerUserGroupService service = securityManager.loadUserGroupService(serviceName); if (service == null) { throw new IllegalArgumentException( "Provided user/group service does not exist: " + serviceName); } else if (service.canCreateStore()) { return securityManager.loadUserGroupService(serviceName).createStore(); } else { throw new IOException("Provided UserGroupService is read-only."); } }
@Override public void doSave(T config) throws Exception { getSecurityManager().saveUserGroupService(config); if (recodeCheckBox.getModelObject()) { GeoServerUserGroupService s = getSecurityManager().loadUserGroupService(config.getName()); if (s.canCreateStore()) { Util.recodePasswords(s.createStore()); } } }
public UserGroupServicePanel(String id, IModel<T> model) { super(id, model); add(new PasswordEncoderChoice("passwordEncoderName").add(new OnChangeAjaxBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { if (recodeCheckBox.isVisible()) { recodeCheckBox.setEnabled(true); target.addComponent(recodeCheckBox); } } })); boolean canCreateStore=false; SecurityUserGroupServiceConfig config = model.getObject(); try { GeoServerUserGroupService s = (GeoServerUserGroupService) Class.forName(config.getClassName()).newInstance(); canCreateStore=s.canCreateStore(); } catch (Exception e) { // do nothing } recodeCheckBox= new CheckBox("recodeExistingPasswords", Model.of(false)); recodeCheckBox.setOutputMarkupId(true); recodeCheckBox.setVisible(canCreateStore); recodeCheckBox.setEnabled(false); add(recodeCheckBox); add(new PasswordPolicyChoice("passwordPolicyName")); }
public UserGroupServicePanel(String id, IModel<T> model) { super(id, model); add(new PasswordEncoderChoice("passwordEncoderName").add(new OnChangeAjaxBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { if (recodeCheckBox.isVisible()) { recodeCheckBox.setEnabled(true); target.addComponent(recodeCheckBox); } } })); boolean canCreateStore=false; SecurityUserGroupServiceConfig config = model.getObject(); try { GeoServerUserGroupService s = (GeoServerUserGroupService) Class.forName(config.getClassName()).newInstance(); canCreateStore=s.canCreateStore(); } catch (Exception e) { // do nothing } recodeCheckBox= new CheckBox("recodeExistingPasswords", Model.of(false)); recodeCheckBox.setOutputMarkupId(true); recodeCheckBox.setVisible(canCreateStore); recodeCheckBox.setEnabled(false); add(recodeCheckBox); add(new PasswordPolicyChoice("passwordPolicyName")); }
@Override public void doSave(T config) throws Exception { getSecurityManager().saveUserGroupService(config); if (recodeCheckBox.getModelObject()) { GeoServerUserGroupService s = getSecurityManager().loadUserGroupService(config.getName()); if (s.canCreateStore()) { Util.recodePasswords(s.createStore()); } } }
@Override public void doSave(T config) throws Exception { getSecurityManager().saveUserGroupService(config); if (recodeCheckBox.getModelObject()) { GeoServerUserGroupService s = getSecurityManager().loadUserGroupService(config.getName()); if (s.canCreateStore()) { Util.recodePasswords(s.createStore()); } } }
public UserGroupServicePanel(String id, IModel<T> model) { super(id, model); add( new PasswordEncoderChoice("passwordEncoderName") .add( new OnChangeAjaxBehavior() { @Override protected void onUpdate(AjaxRequestTarget target) { if (recodeCheckBox.isVisible()) { recodeCheckBox.setEnabled(true); target.add(recodeCheckBox); } } })); boolean canCreateStore = false; SecurityUserGroupServiceConfig config = model.getObject(); try { GeoServerUserGroupService s = (GeoServerUserGroupService) Class.forName(config.getClassName()).newInstance(); canCreateStore = s.canCreateStore(); } catch (Exception e) { // do nothing } recodeCheckBox = new CheckBox("recodeExistingPasswords", Model.of(false)); recodeCheckBox.setOutputMarkupId(true); recodeCheckBox.setVisible(canCreateStore); recodeCheckBox.setEnabled(false); add(recodeCheckBox); add(new PasswordPolicyChoice("passwordPolicyName")); }
protected void headerComponents() { boolean canCreateStore=getService().canCreateStore();
protected void headerComponents() { boolean canCreateStore=getService().canCreateStore();
protected void headerComponents() { boolean canCreateStore=getService().canCreateStore();
protected void headerComponents() { boolean canCreateStore=getService().canCreateStore();
public void testConfiguration() { try { setServices("config"); assertEquals(roleService,getSecurityManager().getActiveRoleService()); //assertEquals(usergroupService,getSecurityManager().getActiveUserGroupService()); assertEquals(usergroupService.getName(), getSecurityManager().loadUserGroupService(getFixtureId()).getName()); assertTrue(roleService.canCreateStore()); assertTrue(usergroupService.canCreateStore()); } catch (Exception ex) { Assert.fail(ex.getMessage()); } }
protected static GeoServerUserGroupService createH2UserGroupService( String serviceName, GeoServerSecurityManager securityManager) throws Exception { if (securityManager.listUserGroupServices().contains(serviceName)) { GeoServerUserGroupService service = securityManager.loadUserGroupService(serviceName); if (service.canCreateStore()) { GeoServerUserGroupStore store = service.createStore(); store.clear(); store.store(); } SecurityUserGroupServiceConfig old = securityManager.loadUserGroupServiceConfig(serviceName); securityManager.removeUserGroupService(old); } securityManager.saveUserGroupService(createConfigObjectH2(serviceName, securityManager)); return securityManager.loadUserGroupService(serviceName); }
@Test public void testConfiguration() throws Exception { setServices("config"); assertEquals(roleService, getSecurityManager().getActiveRoleService()); // assertEquals(usergroupService,getSecurityManager().getActiveUserGroupService()); assertEquals( usergroupService.getName(), getSecurityManager().loadUserGroupService("config").getName()); assertTrue(roleService.canCreateStore()); assertTrue(usergroupService.canCreateStore()); }
@Test public void testConfiguration() throws Exception { setServices("config"); assertEquals(roleService, getSecurityManager().getActiveRoleService()); // assertEquals(usergroupService,getSecurityManager().getActiveUserGroupService()); assertEquals( usergroupService.getName(), getSecurityManager().loadUserGroupService(getFixtureId()).getName()); assertTrue(roleService.canCreateStore()); assertTrue(usergroupService.canCreateStore()); } }