Package org.beangle.security

Examples of org.beangle.security.AuthorizationException


    if (null == realms) {
      realms = restrictionService.getRestrictions(user, resource);
      restrictionMap.put(resource.getId(), realms);
    }
    // 没有权限就报错
    if (realms.isEmpty()) { throw new AuthorizationException(SecurityContextHolder.getContext()
        .getAuthentication(), resource.getName()); }
    return realms;
  }
View Full Code Here


            + " but AbstractSecurityInterceptor only configured to support secure objects of type: "
            + getSecureObjectClass()); }
    Authentication authenticated = authenticateIfRequired();

    // Attempt authorization
    if (!authorityManager.isAuthorized(authenticated, object)) { throw new AuthorizationException(
        object, "access denied"); }
    logger.debug("Authorization successful");

    // AuthorizedEvent event = new AuthorizedEvent(object, attr,
    // authenticated);
View Full Code Here

      ServletException {
    if (exception instanceof AuthenticationException) {
      logger.debug("Authentication exception occurred", exception);
      sendStartAuthentication(request, response, chain, (AuthenticationException) exception);
    } else if (exception instanceof AuthorizationException) {
      AuthorizationException ae = (AuthorizationException) exception;
      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      if (AuthenticationUtils.isValid(auth)) {
        logger.debug("{} access {} is denied", auth.getName(), ae.getResource());
        accessDeniedHandler.handle(request, response, (AuthorizationException) exception);
      } else {
        logger.debug("anonymous access {} is denied", ae.getResource());
        sendStartAuthentication(request, response, chain,
            new AuthenticationException(ae.getMessage()));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.beangle.security.AuthorizationException

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.