Package org.geoserver.security.impl

Examples of org.geoserver.security.impl.ServiceAccessRuleDAO


                };
            }

            protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                // cascade delete the whole selection
                ServiceAccessRuleDAO dao = ServiceAccessRuleDAO.get();
                for (ServiceAccessRule service : selection) {
                    dao.removeRule(service);
                }
                try {
                    dao.storeRules();
                } catch (IOException e) {
                    e.printStackTrace();
                }

                // the deletion will have changed what we see in the page
View Full Code Here


    }

    @Override
    protected void onFormSubmit() {
        try {
            ServiceAccessRuleDAO dao = ServiceAccessRuleDAO.get();
            dao.addRule((ServiceAccessRule) getDefaultModelObject());
            dao.storeRules();
            setResponsePage(ServiceAccessRulePage.class);
        } catch(Exception e) {
            LOGGER.log(Level.SEVERE, "Error occurred while saving service", e);
            error(new ParamResourceModel("saveError", getPage(), e.getMessage()));
        }
View Full Code Here

      String roles = parseRole(rolesForComponent.getRolePalette()
          .getDefaultModelObjectAsString());
      ServiceAccessRule rule = new ServiceAccessRule((String) service
          .getConvertedInput(), (String) method
          .getConvertedInput(), roles);
      ServiceAccessRuleDAO dao = ServiceAccessRuleDAO.get();
      dao.addRule(rule);
      dao.storeRules();
      setResponsePage(ServiceAccessRulePage.class);
    } catch (Exception e) {
      LOGGER.log(Level.SEVERE, "Error occurred while saving user", e);
      error(new ParamResourceModel("saveError", getPage(), e.getMessage()));
    }
View Full Code Here

    }

    @Override
    protected void onFormSubmit(ServiceAccessRule rule) {
        try {
            ServiceAccessRuleDAO dao = ServiceAccessRuleDAO.get();

            //update the original
            orig.getRoles().clear();
            orig.getRoles().addAll(rolesFormComponent.getRolesNamesForStoring());

            dao.storeRules();
            doReturn(ServiceAccessRulePage.class);
        } catch(Exception e) {
            LOGGER.log(Level.SEVERE, "Error occurred while saving rule ", e);
            error(new ParamResourceModel("saveError", getPage(), e.getMessage()));
        }
View Full Code Here

                };
            }

            protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                // cascade delete the whole selection
                ServiceAccessRuleDAO dao = ServiceAccessRuleDAO.get();
                for (ServiceAccessRule service : removePanel.getRoots()) {
                    dao.removeRule(service);
                }
                try {
                    dao.storeRules();
                } catch (IOException e) {
                    e.printStackTrace();
                }

                // the deletion will have changed what we see in the page
View Full Code Here

    }

    @Override
    protected void onFormSubmit(ServiceAccessRule rule) {
        try {
            ServiceAccessRuleDAO dao = ServiceAccessRuleDAO.get();
            dao.addRule(rule);
            dao.storeRules();
            doReturn(ServiceAccessRulePage.class);
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Error occurred while saving service rule", e);
            error(new ParamResourceModel("saveError", getPage(), e.getMessage()));
        }
View Full Code Here

                    new TreeSet<DataAccessRule>(Arrays.asList(dataAccessRule))).anyTimes();
                expect(dataAccessDAO.getRulesAssociatedWithRole("parent1")).andReturn(
                        new TreeSet<DataAccessRule>()).anyTimes();
                expect(secMgr.getDataAccessRuleDAO()).andReturn(dataAccessDAO).anyTimes();

                ServiceAccessRuleDAO serviceAccessDAO = createNiceMock(ServiceAccessRuleDAO.class);
                expect(serviceAccessDAO.getRulesAssociatedWithRole(
                    (String)anyObject())).andReturn(new TreeSet<ServiceAccessRule>()).anyTimes();
                expect(secMgr.getServiceAccessRuleDAO()).andReturn(serviceAccessDAO).anyTimes();
               
                replay(dataAccessDAO, serviceAccessDAO, roleStore, secMgr);
                return secMgr;
View Full Code Here

          }
        }
      }

      protected void initializeServiceRules() throws IOException {
          ServiceAccessRuleDAO dao = ServiceAccessRuleDAO.get();
          dao.getRules();
          dao.addRule(new ServiceAccessRule("wms", "GetMap", "ROLE_AUTHENTICATED"));                   
          dao.addRule(new ServiceAccessRule("wms", "*", "ROLE_WMS"));
          dao.addRule(new ServiceAccessRule("wfs", "GetFeature", "ROLE_AUTHENTICATED"));                   
          dao.addRule(new ServiceAccessRule("wfs", "*", "ROLE_WFS"));
          dao.addRule(new ServiceAccessRule("*", "*", GeoServerRole.ADMIN_ROLE.getAuthority()));
          dao.storeRules();
      }
View Full Code Here

TOP

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

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.