Package org.geoserver.security.impl

Examples of org.geoserver.security.impl.GeoServerUserGroup


            NodeList groupNodes = (NodeList) xmlXPath.getGroupListExpression().evaluate(doc,XPathConstants.NODESET);
            for ( int i=0 ; i <groupNodes.getLength();i++) {
                Node groupNode = groupNodes.item(i);
                String groupName = xmlXPath.getGroupNameExpression().evaluate(groupNode);
                boolean groupEnabled = Util.convertToBoolean(xmlXPath.getGroupEnabledExpression().evaluate(groupNode),true);
                GeoServerUserGroup group= createGroupObject(groupName, groupEnabled);
                helper.groupMap.put(groupName, group);
                NodeList memberNodes = (NodeList) xmlXPath.getGroupMemberListExpression().evaluate(groupNode,XPathConstants.NODESET);
                for ( int j=0 ; j <memberNodes.getLength();j++) {
                    Node memberNode = memberNodes.item(j);
                    String memberName = xmlXPath.getGroupMemberNameExpression().evaluate(memberNode);
View Full Code Here


     */
    public GeoServerUserGroup getGroupByGroupname(String groupname) throws IOException {
        Connection con=null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        GeoServerUserGroup g =null;
        try {
            con = getConnection();           
            ps = getDMLStatement("groups.keyed",con);
            ps.setString(1, groupname);
            rs = ps.executeQuery();
View Full Code Here

            rs = ps.executeQuery();
            while (rs.next()) {               
                String groupname = rs.getString(1);
                String enabledString = rs.getString(2);
                boolean isEnabled= convertFromString(enabledString);
                GeoServerUserGroup g = createGroupObject(groupname, isEnabled);
                tmp.add(g);
            }
        } catch (SQLException ex) {
            throw new IOException(ex);
        } finally {
View Full Code Here

   
    /**
     * @see org.geoserver.security.GeoServerUserGroupService#createGroupObject(java.lang.String, boolean)
     */
    public GeoServerUserGroup createGroupObject(String groupname, boolean isEnabled) throws IOException{
        GeoServerUserGroup group = new GeoServerUserGroup(groupname);
        group.setEnabled(isEnabled);
        return group;
    }
View Full Code Here

            rs = ps.executeQuery();
            while (rs.next()) {               
                String groupname = rs.getString(1);
                String enabledString = rs.getString(2);
                boolean isEnabled= convertFromString(enabledString);
                GeoServerUserGroup g = createGroupObject(groupname, isEnabled);
                tmp.add(g);
            }
        } catch (SQLException ex) {
            throw new IOException(ex);
        } finally {
View Full Code Here

    }
    protected Page editPage(AbstractSecurityPage page,Object...params) {
        if (params.length==0) {
            return new  EditGroupPage(
                    getUserGroupServiceName(),
                    new GeoServerUserGroup("dummygroup")).setReturnPage(page);
        }
        if (params.length==1)
            return new  EditGroupPage(
                    getUserGroupServiceName(),
                    (GeoServerUserGroup) params[0]).setReturnPage(page);
View Full Code Here

    }


    @Override
    protected String getSearchString() throws Exception{
         GeoServerUserGroup g = ugService.getGroupByGroupname("admins");
         assertNotNull(g);
         return g.getGroupname();
    }
View Full Code Here

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

        FormTester form = tester.newFormTester("form");
        form.setValue("enabled", Boolean.FALSE);
        form.submit("save");
        tester.assertRenderedPage(SecurityNamedServiceEditPage.class);
       
        GeoServerUserGroup group = ugService.getGroupByGroupname("group1");
        assertNotNull(group);
        assertFalse(group.isEnabled());

    }
View Full Code Here

            failed=true;
        }
        assertTrue(failed);

        GeoServerUser user1 = store.getUserByUsername("user1");
        GeoServerUserGroup group1 = store.getGroupByGroupname("group1");
        failed=false;
        try {
            store.associateUserToGroup(
                    store.createUserObject("xxx", "abc", true),
                    group1);
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.