public void associateUserToGroup(GeoServerUser user, GeoServerUserGroup group) throws IOException { checkExistingUserName(user.getUsername()); checkExistingGroupName(group.getGroupname()); getStore().associateUserToGroup(user, group); }
public void updateGroup(GeoServerUserGroup group) throws IOException { checkExistingGroupName(group.getGroupname()); getStore().updateGroup(group); }
GeoServerApplication.get().getSecurityManager() .loadUserGroupService(userGroupsServiceName); ugStore = new UserGroupStoreValidationWrapper(ugService.createStore()); for (GeoServerUserGroup group : removePanel.getRoots()) { ugStore.removeGroup(group);
store.addUser(store.createUserObject("", "", true)); } catch (IOException ex) { assertSecurityException(ex, USERNAME_REQUIRED); store.addGroup(store.createGroupObject(null, true)); } catch (IOException ex) { assertSecurityException(ex, GROUPNAME_REQUIRED); store.addUser(store.createUserObject("user1", "abc", true)); store.addGroup(store.createGroupObject("group1", true)); assertEquals(1, store.getUsers().size()); assertEquals(1, store.getUserCount()); assertEquals(1, store.getUserGroups().size()); assertEquals(1, store.getGroupCount()); store.addUser(store.createUserObject("user1", "abc", true)); } catch (IOException ex) { assertSecurityException(ex, USER_ALREADY_EXISTS_$1, "user1"); store.addGroup(store.createGroupObject("group1", true)); } catch (IOException ex) { assertSecurityException(ex, GROUP_ALREADY_EXISTS_$1, "group1"); store.updateUser(store.createUserObject("user1", "abc", false)); store.updateGroup(store.createGroupObject("group1", false)); store.updateUser(store.createUserObject("user1xxxx", "abc", true)); } catch (IOException ex) { assertSecurityException(ex, USER_NOT_FOUND_$1, "user1xxxx");
new UserGroupStoreValidationWrapper(ugService.createStore()); ugStore.updateUser(user); ugStore.store(); ugService.load();
GeoServerApplication.get().getSecurityManager() .loadUserGroupService(userGroupsServiceName); ugStore = new UserGroupStoreValidationWrapper(ugService.createStore()); for (GeoServerUserGroup group : removePanel.getRoots()) { ugStore.removeGroup(group);
GeoServerUserGroupService ugService = GeoServerApplication.get() .getSecurityManager().loadUserGroupService(userGroupsServiceName); ugStore = new UserGroupStoreValidationWrapper(ugService.createStore()); for (GeoServerUser user : removePanel.getRoots()) { ugStore.removeUser(user);
public void disAssociateUserFromGroup(GeoServerUser user, GeoServerUserGroup group) throws IOException { checkExistingUserName(user.getUsername()); checkExistingGroupName(group.getGroupname()); getStore().disAssociateUserFromGroup(user, group); }
GeoServerUserGroupService ugService = GeoServerApplication.get() .getSecurityManager().loadUserGroupService(userGroupsServiceName); ugStore = new UserGroupStoreValidationWrapper(ugService.createStore()); for (GeoServerUser user : removePanel.getRoots()) { ugStore.removeUser(user);
try { if (ugService.canCreateStore()) { ugStore = new UserGroupStoreValidationWrapper(ugService.createStore());
try { if (ugService.canCreateStore()) { ugStore = new UserGroupStoreValidationWrapper(ugService.createStore());
try { if (ugService.canCreateStore()) { ugStore = new UserGroupStoreValidationWrapper(ugService.createStore());
.loadUserGroupService(userGroupsServiceName); ugStore = new UserGroupStoreValidationWrapper( ugService.createStore()); for (GeoServerUserGroup group : removePanel.getRoots()) {
.loadUserGroupService(userGroupsServiceName); ugStore = new UserGroupStoreValidationWrapper( ugService.createStore()); for (GeoServerUser user : removePanel.getRoots()) {
try { if (hasUserGroupStore(userGroupServiceName)) { store = new UserGroupStoreValidationWrapper(getUserGroupStore(userGroupServiceName)); store.updateGroup(group); store.store();
try { if (hasUserGroupStore(userGroupServiceName)) { store = new UserGroupStoreValidationWrapper(getUserGroupStore(userGroupServiceName)); store.updateGroup(group); store.store();
if (hasUserGroupStore(userGroupServiceName)) { store = new UserGroupStoreValidationWrapper( getUserGroupStore(userGroupServiceName)); store.updateGroup(group);
protected UserGroupStoreValidationWrapper createStore(String name) throws IOException { MemoryUserGroupServiceConfigImpl config = new MemoryUserGroupServiceConfigImpl(); config.setName(name); config.setPasswordEncoderName(getPBEPasswordEncoder().getName()); config.setPasswordPolicyName(PasswordValidator.DEFAULT_NAME); GeoServerUserGroupService service = new MemoryUserGroupService(); service.setSecurityManager(getSecurityManager()); service.initializeFromConfig(config); return new UserGroupStoreValidationWrapper(service.createStore()); }
@Override protected void onFormSubmit(GeoServerUserGroup group) throws IOException { GeoServerUserGroupStore store=null; try { store = new UserGroupStoreValidationWrapper(getUserGroupStore(userGroupServiceName)); group = store.createGroupObject(group.getGroupname(),group.isEnabled()); store.addGroup(group); store.store(); } catch (IOException ex) { try { store.load(); } catch (IOException ex2) {}; throw ex; } GeoServerRoleStore gaStore=null; try { if (hasRoleStore(getSecurityManager().getActiveRoleService().getName())) { gaStore = getRoleStore(getSecurityManager().getActiveRoleService().getName()); gaStore = new RoleStoreValidationWrapper(gaStore); for (GeoServerRole role : rolePalette.getSelectedRoles()) { gaStore.associateRoleToGroup(role, group.getGroupname()); } gaStore.store(); } } catch (IOException ex) { try {gaStore.load(); } catch (IOException ex2) {}; throw ex; } }
@Override protected void onFormSubmit(GeoServerUserGroup group) throws IOException { GeoServerUserGroupStore store=null; try { store = new UserGroupStoreValidationWrapper(getUserGroupStore(userGroupServiceName)); group = store.createGroupObject(group.getGroupname(),group.isEnabled()); store.addGroup(group); store.store(); } catch (IOException ex) { try { store.load(); } catch (IOException ex2) {}; throw ex; } GeoServerRoleStore gaStore=null; try { if (hasRoleStore(getSecurityManager().getActiveRoleService().getName())) { gaStore = getRoleStore(getSecurityManager().getActiveRoleService().getName()); gaStore = new RoleStoreValidationWrapper(gaStore); for (GeoServerRole role : rolePalette.getSelectedRoles()) { gaStore.associateRoleToGroup(role, group.getGroupname()); } gaStore.store(); } } catch (IOException ex) { try {gaStore.load(); } catch (IOException ex2) {}; throw ex; } }