Package org.geomajas.security.allowall

Examples of org.geomajas.security.allowall.AllowAllAuthorization


  }

  private Authentication getAuthentication(int which) {
    Authentication auth = new Authentication();
    auth.setAuthorizations(
        new BaseAuthorization[] {which == 1 ? new AllowAllAuthorization() : new AllowNoneAuthorization()});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID + which);
    auth.setUserId(USER_ID);
    return auth;
  }
View Full Code Here


    SecurityContextImpl securityContext = new SecurityContextImpl();
    List<Authentication> authentications = new ArrayList<Authentication>();
    Authentication authentication;
    authentication = new Authentication();
    authentication.setAuthorizations(
        new BaseAuthorization[]{new AllowAllAuthorization(), new AllowNoneAuthorization()});
    authentications.add(authentication);
    securityContext.setAuthentications("token", authentications);
    Assert.assertTrue(securityContext.isToolAuthorized(TOOL_ID));
    Assert.assertTrue(securityContext.isCommandAuthorized(COMMAND_NAME));
    Assert.assertTrue(securityContext.isLayerVisible(LAYER_ID));
View Full Code Here

    SecurityContextImpl securityContext = new SecurityContextImpl();
    List<Authentication> authentications = new ArrayList<Authentication>();
    Authentication authentication;
    authentication = new Authentication();
    authentication.setAuthorizations(
        new BaseAuthorization[]{new AllowNoneAuthorization(), new AllowAllAuthorization()});
    authentications.add(authentication);
    securityContext.setAuthentications("token", authentications);
    Assert.assertTrue(securityContext.isToolAuthorized(TOOL_ID));
    Assert.assertTrue(securityContext.isCommandAuthorized(COMMAND_NAME));
    Assert.assertTrue(securityContext.isLayerVisible(LAYER_ID));
View Full Code Here

    Authentication authentication;
    authentication = new Authentication();
    authentication.setAuthorizations(new BaseAuthorization[]{new AllowNoneAuthorization()});
    authentications.add(authentication);
    authentication = new Authentication();
    authentication.setAuthorizations(new BaseAuthorization[]{new AllowAllAuthorization()});
    authentications.add(authentication);
    securityContext.setAuthentications("token", authentications);
    Assert.assertTrue(securityContext.isToolAuthorized(TOOL_ID));
    Assert.assertTrue(securityContext.isCommandAuthorized(COMMAND_NAME));
    Assert.assertTrue(securityContext.isLayerVisible(LAYER_ID));
View Full Code Here

    Assert.assertEquals(null, context.getUserDivision());
  }

  private Authentication getAuthentication() {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[]{new AllowAllAuthorization()});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID);
    auth.setUserId(USER_ID);
    auth.setUserName(USER_NAME);
    auth.setUserLocale(USER_LOCALE);
    auth.setUserOrganization(USER_ORGANIZATION);
View Full Code Here

    Assert.assertEquals("[[ name is like bla% ] AND [ name is like bla% ]]", filter.toString());
  }

  private Authentication getAuthentication() {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[]{new AllowAllAuthorization()});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID);
    auth.setUserId(USER_ID);
    return auth;
  }
View Full Code Here

  }

  private Authentication getAuthentication(int which) {
    Authentication auth = new Authentication();
    auth.setAuthorizations(
        new BaseAuthorization[] {which == 1 ? new AllowAllAuthorization() : new AllowNoneAuthorization()});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID + which);
    auth.setUserId(USER_ID);
    return auth;
  }
View Full Code Here

  public Authentication getAuthentication(String authenticationToken) {
    if ("TEST".equals(authenticationToken)) {
      Authentication authentication = new Authentication();
      authentication.setUserId("test");
      authentication.setAuthorizations(new BaseAuthorization[]{ new AllowAllAuthorization()});
      return authentication;
    }
    if ("SECOND".equals(authenticationToken)) {
      Authentication authentication = new Authentication();
      authentication.setUserId("second");
      authentication.setAuthorizations(new BaseAuthorization[]{ new AllowAllAuthorization()});
      return authentication;
    }
    return null;
  }
View Full Code Here

  public Authentication getAuthentication(String authenticationToken) {
    if ("TEST".equals(authenticationToken)) {
      Authentication authentication = new Authentication();
      authentication.setUserId("test");
      authentication.setAuthorizations(new BaseAuthorization[]{ new AllowAllAuthorization()});
      return authentication;
    }
    return null;
  }
View Full Code Here

    Assert.assertEquals(USER_DIVISION, securityContext.getUserDivision());
  }

  private Authentication getAuthentication() {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[]{new AllowAllAuthorization()});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID);
    auth.setUserId(USER_ID);
    auth.setUserName(USER_NAME);
    auth.setUserLocale(USER_LOCALE);
    auth.setUserOrganization(USER_ORGANIZATION);
View Full Code Here

TOP

Related Classes of org.geomajas.security.allowall.AllowAllAuthorization

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.