return getEvaluator(clazz).hasPermission(authentication, targetId, targetType, permission);
}
private ModelPermissionEvaluator getEvaluator(Class targetType) throws IllegalArgumentException {
ModelPermissionEvaluator mpe = modelPermissionEvaluatorMap.get(targetType);
if (mpe == null) {
// search for and register a compatible MPE
mpe = findAndRegisterCompatibleModelPermissionEvaluator(targetType);
// at this point, if we still haven't found a compatible MPE, throw exception
if (mpe == null) {