Package org.apache.wicket.authorization

Examples of org.apache.wicket.authorization.Action


   * @throws Exception
   */
  public void testRemove1() throws Exception
  {
    ActionPermissions permissions = new ActionPermissions();
    Action mambo = new Action("mambo");
    assertEquals(null, permissions.rolesFor(mambo));
    permissions.unauthorize(mambo, new Roles("maurice"));
    assertEquals(new Roles(MetaDataRoleAuthorizationStrategy.NO_ROLE),
      permissions.rolesFor(mambo));
  }
View Full Code Here


  public void testRemove2()
  {
    WicketTester tester = new WicketTester();
    tester.setupRequestAndResponse();
    Label<String> label = new Label<String>("label", "text");
    Action mambo = new Action("mambo");
    MetaDataRoleAuthorizationStrategy strategy = new MetaDataRoleAuthorizationStrategy(
      new IRoleCheckingStrategy()
      {

        public boolean hasAnyRole(Roles roles)
View Full Code Here

  public void testRemove3()
  {
    WicketTester tester = new WicketTester();
    tester.setupRequestAndResponse();
    Label<String> label = new Label<String>("label", "text");
    Action mambo = new Action("mambo");
    MetaDataRoleAuthorizationStrategy strategy = new MetaDataRoleAuthorizationStrategy(
      new IRoleCheckingStrategy()
      {

        public boolean hasAnyRole(Roles roles)
View Full Code Here

    WaspAction action = factory.getAction(Component.RENDER);
    assertNotNull(action);
    assertEquals(factory.getAction(Render.class), action);
    assertEquals(factory.getAction("render"), action);

    Action wicketAction = new Action("inherit, render");
    action = factory.getAction(wicketAction);
    assertNotNull(action);
    assertEquals(factory.getAction(wicketAction.getName()), action);

    assertNull(factory.getAction((Action) null));
    assertNull(factory.getAction(new Action("foo")));
  }
View Full Code Here

    WaspAction action = factory.getAction(Component.RENDER);
    assertNotNull(action);
    assertEquals(factory.getAction(Render.class), action);
    assertEquals(factory.getAction("render"), action);

    Action wicketAction = new Action("inherit, render");
    action = factory.getAction(wicketAction);
    assertNotNull(action);
    assertEquals(factory.getAction(wicketAction.getName()), action);

    assertNull(factory.getAction((Action)null));
    assertNull(factory.getAction(new Action("foo")));
  }
View Full Code Here

   * @throws Exception
   */
  public void testAdd1() throws Exception
  {
    ActionPermissions permissions = new ActionPermissions();
    Action mambo = new Action("mambo");
    permissions.authorize(mambo, new Roles("jonathan"));
    permissions.authorize(mambo, new Roles("johan"));
    permissions.authorize(mambo, new Roles("maurice"));
    permissions.authorize(mambo, new Roles("eelco"));
    assertEquals(4, permissions.rolesFor(mambo).size());
View Full Code Here

TOP

Related Classes of org.apache.wicket.authorization.Action

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.