/**
* implementation of JspAuthorizeTag
*/
private boolean ifGranted(String roles, int grantType) {
JspAuthorizeTag authorizeTag = new JspAuthorizeTag();
int result;
try {
switch (grantType) {
case ALL_GRANTED:
authorizeTag.setIfAllGranted(roles);
break;
case ANY_GRANTED:
authorizeTag.setIfAnyGranted(roles);
break;
case NONE_GRANTED:
authorizeTag.setIfNotGranted(roles);
break;
default:
throw new IllegalArgumentException("invalid granted type : " + grantType + " role=" + roles);
}
result = authorizeTag.doStartTag();
} catch (JspException je) {
throw new IllegalArgumentException(je.getMessage());
}
return Tag.EVAL_BODY_INCLUDE == result;