Package net.diegomaia.vraptor.saci.exception

Examples of net.diegomaia.vraptor.saci.exception.RestrictionAnnotationException


      RolesRestriction restriction, OnAccessDenial onMethodAccessDenial,
      OnAccessDenial onResourceAccessDenial) {
    RestrictionResult restrictionResult = new RestrictionResult();
    List<Role> roles = restriction.getRoles();
    if (roles.size() == 0){
      throw new RestrictionAnnotationException("You must specify the roles in the 'roles' attribute within the @Roles annotation.");
    }
    switch (restriction.getPolicy()){
    case CONJUNCTION:
      if (!profile.getRoles().containsAll(restriction.getRolesAsStrings())){
        restrictionResult.setRestricted();
View Full Code Here


  private RestrictionResult checkAccessLevelRestriction(
      Profile profile, AccessLevelRestriction restriction,
      OnAccessDenial onMethodAccessDenial, OnAccessDenial onResourceAccessDenial) {
    RestrictionResult restrictionResult = new RestrictionResult();
    if (restriction.getMinimumAccessLevel() > restriction.getMaximumAccessLevel())
      throw new RestrictionAnnotationException("'minimumAccessLevel' cannot be greater than 'maximumAccessLevel'.");
    if (profile.getAccessLevel() < restriction.getMinimumAccessLevel() || profile.getAccessLevel() > restriction.getMaximumAccessLevel()){
      restrictionResult.setRestricted();
      restrictionResult.setRestrictionReason(RestrictionReason.ACCESS_LEVEL_OUT_OF_RANGE);
      restrictionResult.setDestination(this.getDestination(onMethodAccessDenial, onResourceAccessDenial));
      restrictionResult.setHttp403(this.isHttp403(onMethodAccessDenial, onResourceAccessDenial));
View Full Code Here

TOP

Related Classes of net.diegomaia.vraptor.saci.exception.RestrictionAnnotationException

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.