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

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


  {
    final ActionPermissions permissions = (ActionPermissions)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 (permissions == null)
    {
      permissions = new InstantiationPermissions();
      application.setMetaData(INSTANTIATION_PERMISSIONS, permissions);
    }
    permissions.authorize(componentClass, new Roles(roles));
  }
View Full Code Here

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

    if (componentPackage != null)
    {
      final AuthorizeInstantiation packageAnnotation = componentPackage.getAnnotation(AuthorizeInstantiation.class);
      if (packageAnnotation != null)
      {
        authorized = hasAny(new Roles(packageAnnotation.value()));
      }
    }

    // Check class annotation
    final AuthorizeInstantiation classAnnotation = componentClass.getAnnotation(AuthorizeInstantiation.class);
    if (classAnnotation != null)
    {
      // If roles are defined for the class, that overrides the package
      authorized = hasAny(new Roles(classAnnotation.value()));
    }

    return authorized;
  }
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

  {
    if (authorizeActionAnnotation != null)
    {
      if (action.getName().equals(authorizeActionAnnotation.action()))
      {
        if (hasAny(new Roles(authorizeActionAnnotation.deny())))
        {
          return false;
        }

        Roles roles = new Roles(authorizeActionAnnotation.roles());
        if (!(isEmpty(roles) || hasAny(roles)))
        {
          return false;
        }
      }
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

TOP

Related Classes of org.apache.wicket.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.