Package br.com.caelum.brutauth.auth.annotations

Examples of br.com.caelum.brutauth.auth.annotations.HandledBy


    resourceMethod = methodInfo.getResourceMethod();
  }
 
  public RuleHandler getHandler(BrutauthRule rule) {
    if(resourceMethodContainsSpecificHandler(resourceMethod)){
      HandledBy handledBy = resourceMethod.getMethod().getAnnotation(HandledBy.class);
      return container.instanceFor(handledBy.value());
    }
 
    if(ruleContainsSpecificHandler(rule)){
      HandledBy handledBy = rule.getClass().getAnnotation(HandledBy.class);
      return container.instanceFor(handledBy.value());   
    }
   
    return container.instanceFor(AccessNotAllowedHandler.class);
  }
View Full Code Here


    this.controllerMethod = controllerMethod;
  }

  public RuleHandler getHandler(BrutauthRule rule) {
    if(controllerMethodContainsSpecificHandler(controllerMethod)){
      HandledBy handledBy = controllerMethod.getMethod().getAnnotation(HandledBy.class);
      return container.instanceFor(handledBy.value());
    }
   
    BeanClass resource = controllerMethod.getController();
    if(resourceClassContainsSpecificHandler(resource)){
      HandledBy handledBy = resource.getType().getAnnotation(HandledBy.class);
      return container.instanceFor(handledBy.value());
    }
 
    if(ruleContainsSpecificHandler(rule)){
      HandledBy handledBy = rule.getClass().getAnnotation(HandledBy.class);
      return container.instanceFor(handledBy.value());
    }

    return container.instanceFor(AccessNotAllowedHandler.class);
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.brutauth.auth.annotations.HandledBy

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.