Package org.apache.wicket.security.pages.secure

Examples of org.apache.wicket.security.pages.secure.PageA


    // IsecureComponent
    Map<String, WaspAction> authorized = new HashMap<String, WaspAction>();
    authorized.put(SecureComponentHelper.alias(PageA.class), application.getActionFactory()
      .getAction("access"));
    login(authorized);
    new PageA(); // still allowed here
    authorized.clear();
    authorized.put(SecureComponentHelper.alias(SecureTextField.class), application
      .getActionFactory().getAction("access"));
    logoff(authorized);
    try
    {
      new PageA();
      fail("somehow page was instantiated");
    }
    catch (UnauthorizedInstantiationException e)
    {
      // because we are not allowed to instantiate a SecureTextField
      // anymore
    }
    mock.processRequestCycle();
    try
    {
      tearDown();
      setSecureClass(ISecurePage.class);
      setUp();
    }
    catch (Exception e)
    {
      log.error(e.getMessage(), e);
      fail(e.getMessage());
    }
    doLogin();
    // now we only check pages so all components will be created, this does
    // not affect
    // the render check though
    mock.setupRequestAndResponse();
    logoff(authorized);
    authorized.clear();
    authorized.put(SecureComponentHelper.alias(PageA.class), application.getActionFactory()
      .getAction("access"));
    // need to enable page a again
    login(authorized);
    new PageA(); // only pages are checked so now securetextfield is
    // allowed.
    mock.processRequestCycle();
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.security.pages.secure.PageA

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.