Package org.apache.wicket.security.actions

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


   * @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

  @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

  /**
   * 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

   * 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

  /**
   * 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

   * @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

TOP

Related Classes of org.apache.wicket.security.actions.WaspAction

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.