Package org.apache.wicket.authroles.authorization.strategies.role

Examples of org.apache.wicket.authroles.authorization.strategies.role.Roles


    if (permissions == null)
    {
      permissions = new ActionPermissions();
      component.setMetaData(ACTION_PERMISSIONS, permissions);
    }
    permissions.authorize(action, new Roles(roles));
  }
View Full Code Here


  {
    final InstantiationPermissions permissions = Application.get().getMetaData(
      INSTANTIATION_PERMISSIONS);
    if (permissions != null)
    {
      permissions.unauthorize(componentClass, new Roles(roles));
    }
  }
View Full Code Here

    final String roles)
  {
    final ActionPermissions permissions = component.getMetaData(ACTION_PERMISSIONS);
    if (permissions != null)
    {
      permissions.unauthorize(action, new Roles(roles));
    }
  }
View Full Code Here

    if (action == null)
    {
      throw new IllegalArgumentException("argument action has to be not null");
    }

    final Roles roles = rolesAuthorizedToPerformAction(component, action);
    if (roles != null)
    {
      return hasAny(roles);
    }
    return true;
View Full Code Here

    {
      throw new IllegalArgumentException("argument componentClass must be of type " +
        Component.class.getName());
    }

    final Roles roles = rolesAuthorizedToInstantiate(componentClass);
    if (roles != null)
    {
      return hasAny(roles);
    }
    return true;
View Full Code Here

    if (rolesToAdd == null)
    {
      throw new IllegalArgumentException("Argument rolesToAdd cannot be null");
    }

    Roles roles = rolesForAction.get(action);
    if (roles == null)
    {
      roles = new Roles();
      rolesForAction.put(action, roles);
    }
    roles.addAll(rolesToAdd);
  }
View Full Code Here

    if (rolesToRemove == null)
    {
      throw new IllegalArgumentException("Argument rolesToRemove cannot be null");
    }

    Roles roles = rolesForAction.get(action);
    if (roles != null)
    {
      roles.removeAll(rolesToRemove);
    }
    else
    {
      roles = new Roles();
      rolesForAction.put(action, roles);
    }

    // If we removed the last authorized role, we authorize the empty role
    // so that removing authorization can't suddenly open something up to
    // everyone.
    if (roles.size() == 0)
    {
      roles.add(MetaDataRoleAuthorizationStrategy.NO_ROLE);
    }
  }
View Full Code Here

    if (rolesToAdd == null)
    {
      throw new IllegalArgumentException("Argument rolesToadd cannot be null");
    }

    Roles roles = rolesForComponentClass.get(componentClass);
    if (roles == null)
    {
      roles = new Roles();
      rolesForComponentClass.put(componentClass, roles);
    }
    roles.addAll(rolesToAdd);
  }
View Full Code Here

    if (rolesToRemove == null)
    {
      throw new IllegalArgumentException("Argument rolesToRemove cannot be null");
    }

    Roles roles = rolesForComponentClass.get(componentClass);
    if (roles != null)
    {
      roles.removeAll(rolesToRemove);
    }
    else
    {
      roles = new Roles();
      rolesForComponentClass.put(componentClass, roles);
    }

    // If we removed the last authorized role, we authorize the empty role
    // so that removing authorization can't suddenly open something up to
    // everyone.
    if (roles.size() == 0)
    {
      roles.add(MetaDataRoleAuthorizationStrategy.NO_ROLE);
    }
  }
View Full Code Here

   * @see IRoleCheckingStrategy#hasAnyRole(Roles)
   */
  @Override
  public final boolean hasAnyRole(final Roles roles)
  {
    final Roles sessionRoles = AbstractAuthenticatedWebSession.get().getRoles();
    return (sessionRoles != null) && sessionRoles.hasAnyRole(roles);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.authroles.authorization.strategies.role.Roles

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.