Package org.beangle.security.access

Examples of org.beangle.security.access.AccessDeniedException


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

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

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


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

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

    UserProfile profile = getUserProfile();
    List<Restriction> holders = restrictionService.getRestrictions(profile, resource);
    // restrictionMap.put(resource.getId(), realms);
    // }
    // 没有权限就报错
    if (holders.isEmpty()) { throw new AccessDeniedException(SecurityContextHolder.getContext()
        .getAuthentication(), resource.getName()); }
    return holders;
  }
View Full Code Here

    UserProfile profile = getUserProfile();
    List<Restriction> holders = restrictionService.getRestrictions(profile, resource);
    // restrictionMap.put(resource.getId(), realms);
    // }
    // 没有权限就报错
    if (holders.isEmpty()) { throw new AccessDeniedException(SecurityContextHolder.getContext()
        .getAuthentication(), resource.getName()); }
    return holders;
  }
View Full Code Here

TOP

Related Classes of org.beangle.security.access.AccessDeniedException

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.