Author: rareddy
Date: 2010-09-24 14:27:53 -0400 (Fri, 24 Sep 2010)
New Revision: 2602
Modified:
branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
Log:
TEIID-1275: fixing the code to get model-id correctly from element symbols.
Modified:
branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java
===================================================================
---
branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2010-09-24
18:27:41 UTC (rev 2601)
+++
branches/7.1.x/engine/src/main/java/org/teiid/dqp/internal/process/AuthorizationValidationVisitor.java 2010-09-24
18:27:53 UTC (rev 2602)
@@ -231,18 +231,22 @@
Object metadataID = null;
if(symbol instanceof ElementSymbol) {
metadataID = ((ElementSymbol)symbol).getMetadataID();
- GroupSymbol groupSymbol = ((ElementSymbol)symbol).getGroupSymbol();
- if (metadataID instanceof MultiSourceElement || metadataID instanceof
TempMetadataID || groupSymbol == null || isSystemModel(groupSymbol.getMetadataID())) {
+ if (metadataID instanceof MultiSourceElement || metadataID instanceof
TempMetadataID) {
continue;
}
} else if(symbol instanceof GroupSymbol) {
GroupSymbol group = (GroupSymbol)symbol;
metadataID = group.getMetadataID();
- if ((metadataID instanceof TempMetadataID &&
!group.isProcedure()) || isSystemModel(metadataID)) {
+ if (metadataID instanceof TempMetadataID &&
!group.isProcedure()) {
continue;
}
}
fullName = getMetadata().getFullName(metadataID);
+ Object modelId = getMetadata().getModelID(metadataID);
+ String modelName = getMetadata().getFullName(modelId);
+ if (CoreConstants.SYSTEM_MODEL.equals(modelName) ||
CoreConstants.ODBC_MODEL.equals(modelName)) {
+ continue;
+ }
nameToSymbolMap.put(fullName, symbol);
} catch(QueryMetadataException e) {
handleException(e);
@@ -267,14 +271,7 @@
inaccessibleSymbols);
}
}
-
}
-
- private boolean isSystemModel(Object groupMetadataID) throws QueryMetadataException,
TeiidComponentException {
- Object modelId = getMetadata().getModelID(groupMetadataID);
- String modelName = getMetadata().getFullName(modelId);
- return (CoreConstants.SYSTEM_MODEL.equals(modelName) ||
CoreConstants.ODBC_MODEL.equals(modelName));
- }
/**
* Out of resources specified, return the subset for which the specified not have
authorization to access.
Show replies by date