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));