Package org.geoserver.security.impl

Examples of org.geoserver.security.impl.GeoServerUserGroup


        assertEquals(user2.getProperties().getProperty("mail"),"user2@gmx.com");
        assertEquals(user2.getProperties().getProperty("tel"),"12-34-38");
   
        assertEquals(4, userGroupService.getUserGroups().size());
        assertEquals(4, userGroupService.getGroupCount());
        GeoServerUserGroup admins = userGroupService.getGroupByGroupname("admins");
        GeoServerUserGroup group1 = userGroupService.getGroupByGroupname("group1");
        GeoServerUserGroup group2 = userGroupService.getGroupByGroupname("group2");
        GeoServerUserGroup disabledgroup = userGroupService.getGroupByGroupname("disabledgroup");
       
        assertNull(userGroupService.getGroupByGroupname("yyy"));
       
        assertTrue(userGroupService.getUserGroups().contains(admins));
        assertTrue(userGroupService.getUserGroups().contains(group1));
        assertTrue(userGroupService.getUserGroups().contains(group2));
        assertTrue(userGroupService.getUserGroups().contains(disabledgroup));
   
        assertTrue(admins.isEnabled());
        assertTrue(group1.isEnabled());
        assertTrue(group2.isEnabled());
        assertFalse(disabledgroup.isEnabled());
       
        assertEquals(2,userGroupService.getUsersForGroup(group1).size());
        assertTrue(userGroupService.getUsersForGroup(group1).contains(user1));
        assertTrue(userGroupService.getUsersForGroup(group1).contains(user2));
        // check if properties are loaded too
View Full Code Here


       
        GeoServerUser user2 = userGroupService.getUserByUsername("user2");
        assertEquals(1, user2.getProperties().size());
        assertEquals("11-22-33", user2.getProperties().getProperty("tel"));
       
        GeoServerUserGroup disabledgroup = userGroupService.getGroupByGroupname("disabledgroup");
        assertTrue(disabledgroup.isEnabled());
   
        GeoServerUserGroup group1 = userGroupService.getGroupByGroupname("group1");
        GeoServerUser user1 = userGroupService.getUserByUsername("user1");
        assertEquals(1,userGroupService.getUsersForGroup(group1).size());
        assertTrue(userGroupService.getUsersForGroup(group1).contains(user1));
   
        assertEquals(0,userGroupService.getGroupsForUser(user2).size());
View Full Code Here

        assertTrue(userGroupService.getUsers().contains(admin));
        assertTrue(userGroupService.getUsers().contains(user1));
        assertTrue(userGroupService.getUsers().contains(disableduser));
        assertTrue(userGroupService.getUsers().contains(groupAdminUser));
       
        GeoServerUserGroup admins = userGroupService.getGroupByGroupname("admins");
        GeoServerUserGroup group1 = userGroupService.getGroupByGroupname("group1");
        assertEquals(3, userGroupService.getUserGroups().size());
        assertEquals(3, userGroupService.getGroupCount());
        assertTrue(userGroupService.getUserGroups().contains(admins));
        assertTrue(userGroupService.getUserGroups().contains(group1));
   
View Full Code Here

        userGroupStore.addUser(user1);
        userGroupStore.addUser(user2);
        userGroupStore.addUser(disableduser);
        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);
       
        userGroupStore.addGroup(admins);
        userGroupStore.addGroup(group1);
        userGroupStore.addGroup(disabledgroup);
        userGroupStore.addGroup(group2);
View Full Code Here

        GeoServerUser user2 = userGroupStore.getUserByUsername("user2");
        user2.getProperties().remove("mail");
        user2.getProperties().put("tel", "11-22-33");
        userGroupStore.updateUser(user2);
       
        GeoServerUserGroup disabledgroup = userGroupStore.getGroupByGroupname("disabledgroup");
        disabledgroup.setEnabled(true);
        userGroupStore.updateGroup(disabledgroup);
               
        GeoServerUserGroup group1 = userGroupStore.getGroupByGroupname("group1");
        userGroupStore.disAssociateUserFromGroup(user2, group1);
       
    }
View Full Code Here

    public void removeValues(GeoServerUserGroupStore userGroupStore) throws IOException {
        GeoServerUser user2 = userGroupStore.getUserByUsername("user2");
        if (user2 != null) {
            userGroupStore.removeUser(user2);
        }
        GeoServerUserGroup disabledGroup = userGroupStore.getGroupByGroupname("disabledgroup");
        if (disabledGroup != null) {
            userGroupStore.removeGroup(disabledGroup);
        }
    }
View Full Code Here

        GeoServerUser user = ugStore.createUserObject(username, password, true);
        ugStore.addUser(user);

        if (groups != null && !groups.isEmpty()) {
            for (String groupName : groups) {
                GeoServerUserGroup group = ugStore.getGroupByGroupname(groupName);
                if (group == null) {
                    group = ugStore.createGroupObject(groupName, true);
                    ugStore.addGroup(group);
                }
   
View Full Code Here

        }
    }
   
    protected  void addGroups(GeoServerUserGroupStore ugStore, String... groupNames) throws IOException {
        for (String groupName : groupNames) {
            GeoServerUserGroup grp = new GeoServerUserGroup(groupName);
            expect(ugStore.getGroupByGroupname(groupName)).andReturn(grp).anyTimes();
        }
    }
View Full Code Here

        form.submit("save");
        tester.assertRenderedPage(SecurityNamedServiceEditPage.class);

        tester.assertErrorMessages(new String[0]);
       
        GeoServerUserGroup group = ugService.getGroupByGroupname("testgroup");
        assertNotNull(group);
        assertFalse(group.isEnabled());
        SortedSet<GeoServerRole> roleList = gaService.getRolesForGroup("testgroup");
        assertEquals(1,roleList.size());
        assertEquals("ROLE_NEW",roleList.iterator().next().getAuthority());
       
    }
View Full Code Here

       
        FormTester form = tester.newFormTester("form");
        form.setValue("groupname", "testgroup");
        form.submit("save");
       
        GeoServerUserGroup group = ugService.getGroupByGroupname("testgroup");
        assertNotNull(group);
        assertTrue(group.isEnabled());
        SortedSet<GeoServerRole> roleList = gaService.getRolesForGroup("testgroup");
        assertEquals(0,roleList.size());
    }
View Full Code Here

TOP

Related Classes of org.geoserver.security.impl.GeoServerUserGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.