Package org.geoserver.security.impl

Examples of org.geoserver.security.impl.DataAccessRule


        form.submit("save");
       
        tester.assertErrorMessages(new String[0]);
        tester.assertRenderedPage(DataSecurityPage.class);

        DataAccessRule rule = getRule(ruleName);
        assertNotNull(rule);
        assertEquals(1,rule.getRoles().size());
        assertEquals(GeoServerRole.ANY_ROLE,rule.getRoles().iterator().next());       
    }
View Full Code Here


    protected Page newPage(Object...params) {
        return new  NewDataAccessRulePage();
    }
    protected Page editPage(Object...params) {
        if (params.length==0)
            return new  EditDataAccessRulePage( new DataAccessRule("it.geosolutions", "layer.dots",
                    AccessMode.READ, Collections.singleton("ROLE_ABC")));
        else
            return new  EditDataAccessRulePage( (DataAccessRule) params[0]);
    }
View Full Code Here

        return null;
    }

    @Override
    protected String getRemoveableObjectRegExp() throws Exception {
        DataAccessRule rule = getRemoveableObject();
        return ".*"+rule.getWorkspace() + ".*" + rule.getLayer()
                +".*" + "ROLE_WFS"+".*";               
    }
View Full Code Here

        form.submit("save");
       
        tester.assertErrorMessages(new String[0]);
        tester.assertRenderedPage(DataSecurityPage.class);

        DataAccessRule foundRule=null;
        for (DataAccessRule rule : DataAccessRuleDAO.get().getRules()) {
            if (MockData.CITE_PREFIX.equals(rule.getWorkspace())
                    && MockData.STREAMS.getLocalPart().equals(rule.getLayer())
                    && AccessMode.READ.equals(rule.getAccessMode())) {
                foundRule = rule;
                break;
            }
        }
        assertNotNull(foundRule);
        assertEquals(1,foundRule.getRoles().size());
        assertEquals("ROLE_NEW",foundRule.getRoles().iterator().next());       
    }
View Full Code Here

        tester.clickLink("form:cancel");
        tester.assertRenderedPage(NewDataAccessRulePage.class);
       
        DataAccessRuleDAO dao = DataAccessRuleDAO.get();

        DataAccessRule rule = new DataAccessRule(MockData.CITE_PREFIX, MockData.STREAMS.getLocalPart(), AccessMode.ADMIN);
        assertFalse(dao.getRules().contains(rule));
      
        // now save
        form=tester.newFormTester("form");
        form.submit("save");
View Full Code Here

//                      + ":" +info.getName());
//          }
         
          DataAccessRuleDAO dao = DataAccessRuleDAO.get();
          dao.getRules();
          dao.addRule(new DataAccessRule("*", "*", AccessMode.WRITE,
                  GeoServerRole.ADMIN_ROLE.getAuthority()));
          dao.addRule(new DataAccessRule(MockData.CITE_PREFIX, "*", AccessMode.READ,                  
                  "ROLE_AUTENTICATED"));
          dao.addRule(new DataAccessRule(MockData.CITE_PREFIX, MockData.LAKES.getLocalPart(), AccessMode.WRITE,                  
                  "ROLE_WMS,ROLE_WFS"));
          dao.addRule(new DataAccessRule(MockData.CITE_PREFIX, MockData.BRIDGES.getLocalPart(), AccessMode.WRITE,                  
                  "ROLE_WMS,ROLE_WFS"));         
          dao.storeRules();

      }
View Full Code Here

    }
   
    public void testRemoveDataAccessRule() {
        Set<String> roles = new HashSet<String>();
        roles.add("*");
        setupPanel(new DataAccessRule("*","*",AccessMode.READ,roles));
       
        // print(tester.getLastRenderedPage(), true, true);
       
        tester.assertRenderedPage(FormTestPage.class);
        tester.assertNoErrorMessage();
View Full Code Here

    private static final String TABLE_PATH = "selectLayersContainer:selectLayers:layers";

    @Override
    protected void setUpInternal() throws Exception {
        dao = DataAccessRuleDAO.get();
        rule = new DataAccessRule(MockData.CITE_PREFIX, MockData.BASIC_POLYGONS.getLocalPart(),
                AccessMode.READ, "*");
        dao.addRule(DataAccessRule.READ_ALL);
        dao.addRule(DataAccessRule.WRITE_ALL);
        dao.addRule(rule);
        login();
View Full Code Here

        tester.assertErrorMessages(new String[0]);
        tester.assertRenderedPage(DataAccessRulePage.class);
       
        dao.reload();
        assertEquals(1, dao.getRules().size());
        DataAccessRule rule = dao.getRules().get(0);
        assertEquals("cite", rule.getWorkspace());
        assertEquals("*", rule.getLayer());
        assertEquals(AccessMode.WRITE, rule.getAccessMode());
//        // palette and form submit in tester, just does not work... :-(
//        assertEquals(0, rule.getRoles());
//        assertEquals("*", rule.getRoles().iterator().next());
    }
View Full Code Here

*/
@SuppressWarnings("serial")
public class NewDataAccessRulePage extends AbstractDataAccessRulePage {

    public NewDataAccessRulePage() {
        super(new DataAccessRule());
        form.add(new DuplicateRuleValidator());
    }
View Full Code Here

TOP

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

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.