Package org.geoserver.security

Examples of org.geoserver.security.DataAccessRule


    }
   
    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

    RolesFormComponent rolesForComponent;

    Form form;

    public AbstractDataAccessRulePage(DataAccessRule rule) {
        setModel(new CompoundPropertyModel(new DataAccessRule(rule)));

        // build the form
        form = new Form("ruleForm");
        add(form);
        form.add(workspace = new DropDownChoice("workspace", getWorkspaceNames()));
View Full Code Here

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

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

    @Override
    protected void onFormSubmit() {
        try {
            String roles = parseRole(rolesForComponent.getRolePalette().getModelObjectAsString());
            DataAccessRule rule = new DataAccessRule((String) workspace.getConvertedInput(),
                    (String) layer.getConvertedInput(),
                    (AccessMode) accessMode.getConvertedInput(), roles);
            DataAccessRuleDAO dao = DataAccessRuleDAO.get();
            dao.addRule(rule);
            dao.storeRules();
View Full Code Here

     * @author aaime
     *
     */
    class DuplicateRuleValidator extends AbstractFormValidator {
        public void validate(Form form) {
            DataAccessRule rule = new DataAccessRule((String) workspace.getConvertedInput(),
                    (String) layer.getConvertedInput(),
                    (AccessMode) accessMode.getConvertedInput(), rolesForComponent.getRolePalette()
                            .getModelObjectAsString());
            if (DataAccessRuleDAO.get().getRules().contains(rule)) {
                form.error(new ParamResourceModel("duplicateRule", getPage(), rule.getKey())
                        .getString());
            }
        }
View Full Code Here

TOP

Related Classes of org.geoserver.security.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.