Examples of WaspAction


Examples of org.apache.wicket.security.actions.WaspAction

    // the department entity not to be confused with the department action
    // further down.
    Department department = getObject();
    // for secure departments you need organization rights, else
    // department rights are sufficient
    WaspAction myAction =
      action
        .add(getActionFactory()
          .getAction(
            department.secure
              ? Organization.class
View Full Code Here

Examples of org.apache.wicket.security.actions.WaspAction

   * @see org.apache.wicket.security.checks.ComponentSecurityCheck#isActionAuthorized(org.apache.wicket.security.actions.WaspAction)
   */
  @Override
  public boolean isActionAuthorized(WaspAction action)
  {
    WaspAction myAction = action.add(getActionFactory().getAction(Organization.class));
    return super.isActionAuthorized(myAction);
  }
View Full Code Here

Examples of org.apache.wicket.security.actions.WaspAction

  @Override
  public boolean isActionAuthorized(WaspAction action)
  {
    // for secure departments you need organization rights, else department
    // rights are sufficient
    WaspAction myAction =
      action
        .add(getActionFactory()
          .getAction(
            secureDepartment
              ? Organization.class
View Full Code Here

Examples of org.apache.wicket.security.actions.WaspAction

  /**
   * Test method for {@link SwarmAction#hashCode()}
   */
  public void testHashCode()
  {
    WaspAction action = new SwarmAction(5, "test", KEY);
    // persistent
    assertEquals(action.hashCode(), action.hashCode());
    WaspAction action2 = new SwarmAction(5, "test", KEY);
    // equal
    assertEquals(action.hashCode(), action2.hashCode());
    WaspAction action3 = new TestAction(5, "does not matter", KEY);
    assertEquals(action2, action3);
    assertTrue(action3.hashCode() == action2.hashCode());

  }
View Full Code Here

Examples of org.apache.wicket.security.actions.WaspAction

   * Test method for {@link SwarmAction#implies(WaspAction)}
   */
  public void testImpliesWaspAction()
  {
    ActionFactory factory = Actions.getActionFactory(KEY);
    WaspAction action = factory.getAction(Render.class);
    WaspAction action2 = action.add(factory.getAction(Inherit.class));
    assertTrue(action2.implies(action));
    assertFalse(action.implies(action2));
  }
View Full Code Here

Examples of org.apache.wicket.security.actions.WaspAction

  /**
   * Test method for {@link SwarmAction#equals(Object)}
   */
  public void testEqualsObject()
  {
    WaspAction action = new SwarmAction(5, "test", KEY);
    // null
    assertFalse(action.equals(null));
    // reflexive
    assertEquals(action, action);
    // symmetric
    WaspAction action2 = new SwarmAction(5, "test", KEY);
    assertEquals(action, action2);
    assertEquals(action2, action);
    WaspAction action3 = new SwarmAction(6, "test2", KEY);
    assertFalse(action.equals(action3));
    assertFalse(action3.equals(action));
    // transitive
    WaspAction action4 = new TestAction(5, "test", KEY);
    assertEquals(action, action4);
    assertEquals(action4, action2);
    // action2 already equals action
    // consistent
    // action is inmutable so it is consistent
View Full Code Here

Examples of org.apache.wicket.security.actions.WaspAction

   * @param action
   * @return
   */
  private boolean isAuthorized(String alias, WaspAction action)
  {
    WaspAction authorizedAction = authorized.get(alias);
    if (authorizedAction == null)
      return false;
    return authorizedAction.implies(action);
  }
View Full Code Here

Examples of org.wicketstuff.security.actions.WaspAction

   * @param action
   * @return
   */
  private boolean isAuthorized(String alias, WaspAction action)
  {
    WaspAction authorizedAction = authorized.get(alias);
    if (authorizedAction == null)
      return false;
    return authorizedAction.implies(action);
  }
View Full Code Here

Examples of org.wicketstuff.security.actions.WaspAction

  /**
   * Test for {@link AllActions}.
   */
  public void testAllActions()
  {
    WaspAction action = factory.getAction(AllActions.class);
    assertNotNull(action);
    List<WaspAction> actions = factory.getRegisteredActions();
    assertFalse(actions.isEmpty());
    for (int i = 0; i < actions.size(); i++)
    {
      assertTrue(action.implies(actions.get(i)));
    }
    try
    {
      factory.register(AllActions.class, "all");
      fail("Should not be able to register the 'all' action");
    }
    catch (RegistrationException e)
    {
      log.debug(e.getMessage());
    }
    WaspAction action2 = factory.getAction("all"); // caches the name all
    assertEquals(action, action2);
    assertNotSame(action, action2);
    // not same since AllActions.class will always deliver a new instance
    assertSame(action2, factory.getAction("all")); // cache lookup
  }
View Full Code Here

Examples of org.wicketstuff.security.actions.WaspAction

  /**
   * @see SwarmActionFactory#getAction(Action)
   */
  public void testGetActionAction()
  {
    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");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.