retLst.addAll(MethodPermission.unroll(permType, getFinderMethodBySignature(finderTag.getSignature()),
finderTag.getRoleNames()));
}
}
EjbPkTag pkTag = (EjbPkTag) javaClass.getTagByName(TagLibrary.EJB_PK);
if (pkTag != null) {
// -------------------------------------------------------
// We are generating an method permission if there is at least
// one role or unchecked is true
// NOTE: unchecked is only valid for EJB 2.0+
boolean canContinue = (pkTag.getRoleNames() != null && pkTag.getRoleNames().length > 0);
if (version.greaterOrEquals(EjbVersion.EJB_2_0)) {
canContinue |= pkTag.isUnchecked();
}
// We'll not continue this if we do not have to check a security method for
// "findByPrimaryKey"
if (canContinue) {
int permType = getViewType(javaClass) & (REMOTE_HOME | LOCAL_HOME);
// -------------------------------------------------------
// Let's "bitwise and" to get only the specied masks
// that are compatible with the bean
// HUMM: Is this valid ?
if (pkTag.getMethodIntf() != null) {
permType &= getInterfaceType(pkTag.getMethodIntf());
}
if (permType == 0) {
throw getErrorWithTagLocation(pkTag,
"Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
}
// Lets expand by permission for interface type
// Method signature should maybe be unrolled by permType, but it's not really relevant
// the return type, soo..
retLst.addAll(MethodPermission.unroll(permType,
getFinderMethodBySignature("void findByPrimaryKey()"), pkTag.getRoleNames()));
}
}
}
return retLst;