store.createGroupObject(group.getGroupname(), group.isEnabled()); store.addGroup(newGroup); newGroupDict.put(newGroup.getGroupname(), newGroup);
userGroupStore.addUser(groupAdminUser); GeoServerUserGroup admins = userGroupStore.createGroupObject("admins", true); GeoServerUserGroup group1 = userGroupStore.createGroupObject("group1", true); GeoServerUserGroup group2 = userGroupStore.createGroupObject("group2", true); GeoServerUserGroup disabledgroup = userGroupStore.createGroupObject("disabledgroup", false);
GeoServerUserGroup group = ugStore.getGroupByGroupname(groupName); if (group == null) { group = ugStore.createGroupObject(groupName, true); ugStore.addGroup(group);
GeoServerUserGroup group = store1.createGroupObject("group", true);
@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; } }
GeoServerUserGroup group = store2.createGroupObject("group", true);
GeoServerUserGroup theGroup1 = usergroupStore.createGroupObject("theGroup1", true); usergroupStore.addGroup(theGroup1); usergroupStore.associateUserToGroup(theUser, theGroup1); GeoServerUserGroup theGroup2 = usergroupStore.createGroupObject("theGroup2", false); usergroupStore.addGroup(theGroup2); usergroupStore.associateUserToGroup(theUser, theGroup2);
try { store = new UserGroupStoreValidationWrapper(getUserGroupStore(userGroupServiceName)); group = store.createGroupObject(group.getGroupname(), group.isEnabled()); store.addGroup(group); store.store();
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); // set up the services GeoServerUserGroupService ugService = createUserGroupService("gaugs"); GeoServerRoleService roleService = createRoleService("gars"); getSecurityManager().setActiveRoleService(roleService); // add the users GeoServerUserGroupStore ugStore = createStore(ugService); GeoServerUser bob = ugStore.createUserObject("bob", "foobar", true); GroupAdminProperty.set(bob.getProperties(), new String[] {"users"}); ugStore.addUser(bob); GeoServerUser alice = ugStore.createUserObject("alice", "foobar", true); ugStore.addUser(alice); GeoServerUserGroup users = ugStore.createGroupObject("users", true); ugStore.addGroup(users); GeoServerUserGroup admins = ugStore.createGroupObject("admins", true); ugStore.addGroup(admins); ugStore.store(); // grant bob group admin privilege GeoServerRole groupAdminRole = null; GeoServerRoleStore roleStore = createStore(roleService); roleStore.addRole(roleStore.createRoleObject("adminRole")); roleStore.addRole(groupAdminRole = roleStore.createRoleObject("groupAdminRole")); roleStore.associateRoleToUser(groupAdminRole, bob.getUsername()); roleStore.store(); }
GeoServerUserGroup group = store.createGroupObject("gggg", true);