Package org.apache.wicket.authorization

Examples of org.apache.wicket.authorization.Action


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


   * @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()
  {
    Label label = new Label("label", "text");
    Action mambo = new Action("mambo");
    MetaDataRoleAuthorizationStrategy strategy = new MetaDataRoleAuthorizationStrategy(
      new IRoleCheckingStrategy()
      {

        public boolean hasAnyRole(Roles roles)
View Full Code Here

   * it with {@link #testRemove2()}.
   */
  public void testRemove3()
  {
    Label label = new Label("label", "text");
    Action mambo = new Action("mambo");
    MetaDataRoleAuthorizationStrategy strategy = new MetaDataRoleAuthorizationStrategy(
      new IRoleCheckingStrategy()
      {

        public boolean hasAnyRole(Roles roles)
View Full Code Here

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

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

   */
  @Test
  public void testRemove2()
  {
    Label label = new Label("label", "text");
    Action mambo = new Action("mambo");
    MetaDataRoleAuthorizationStrategy strategy = new MetaDataRoleAuthorizationStrategy(
      new IRoleCheckingStrategy()
      {
        @Override
        public boolean hasAnyRole(Roles roles)
View Full Code Here

   */
  @Test
  public void testRemove3()
  {
    Label label = new Label("label", "text");
    Action mambo = new Action("mambo");
    MetaDataRoleAuthorizationStrategy strategy = new MetaDataRoleAuthorizationStrategy(
      new IRoleCheckingStrategy()
      {
        @Override
        public boolean hasAnyRole(Roles roles)
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

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

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.