private Boolean isAccessible(AbstractMetadataRecord record, CommandContext commandContext, PermissionType action) { Boolean result = commandContext.isAccessible(record); if (result != null) { return result; } HashSet<String> resources = new HashSet<String>(2); resources.add(record.getFullName()); return this.policyDecider.getInaccessibleResources(action, resources, Context.METADATA, commandContext).isEmpty(); }
@Override public boolean hasRole(String roleName, CommandContext commandContext) { if (policyDecider == null) { return true; } return this.policyDecider.hasRole(roleName, commandContext); }
@Override public boolean isAccessible(AbstractMetadataRecord record, CommandContext commandContext) { if (policyDecider == null || !policyDecider.validateCommand(commandContext) result = this.policyDecider.getInaccessibleResources(action, resources, Context.METADATA, commandContext).isEmpty(); commandContext.setAccessible(record, result); return result;
private void validateTemp(DataPolicy.PermissionType action, String resource, boolean schema, LanguageObject object, Context context) { Set<String> resources = Collections.singleton(resource); logRequest(resources, context); boolean allowed = decider.isTempAccessible(action, schema?resource:null, context, commandContext); logResult(resources, context, allowed); if (!allowed) { handleValidationError( QueryPlugin.Util.getString("ERR.018.005.0095", commandContext.getUserName(), "CREATE_TEMPORARY_TABLES"), //$NON-NLS-1$ //$NON-NLS-2$ Arrays.asList(object)); } }
@Override public boolean isAccessible(AbstractMetadataRecord record, CommandContext commandContext) { if (policyDecider == null || !policyDecider.validateCommand(commandContext)) { return true;
TeiidComponentException { boolean modified = false; if (policyDecider != null && policyDecider.validateCommand(commandContext)) { if (ignoreUnathorizedInAsterisk(command, commandContext)) { Query query = (Query)command; Set<String> results = this.policyDecider.getInaccessibleResources(PermissionType.READ, map.keySet(), Context.QUERY, commandContext); if (!results.isEmpty()) {
private void validateTemp(DataPolicy.PermissionType action, String resource, boolean schema, LanguageObject object, Context context) { Set<String> resources = Collections.singleton(resource); logRequest(resources, context); boolean allowed = decider.isTempAccessible(action, schema?resource:null, context, commandContext); logResult(resources, context, allowed); if (!allowed) { handleValidationError( QueryPlugin.Util.getString("ERR.018.005.0095", commandContext.getUserName(), "CREATE_TEMPORARY_TABLES"), //$NON-NLS-1$ //$NON-NLS-2$ Arrays.asList(object)); } }
@Override public boolean isAccessible(AbstractMetadataRecord record, CommandContext commandContext) { if (policyDecider == null || !policyDecider.validateCommand(commandContext)) { return true;
TeiidComponentException { boolean modified = false; if (policyDecider != null && policyDecider.validateCommand(commandContext)) { if (ignoreUnathorizedInAsterisk(command, commandContext)) { Query query = (Query)command; Set<String> results = this.policyDecider.getInaccessibleResources(PermissionType.READ, map.keySet(), Context.QUERY, commandContext); if (!results.isEmpty()) {
private Boolean isAccessible(AbstractMetadataRecord record, CommandContext commandContext, PermissionType action) { Boolean result = commandContext.isAccessible(record); if (result != null) { return result; } HashSet<String> resources = new HashSet<String>(2); resources.add(record.getFullName()); return this.policyDecider.getInaccessibleResources(action, resources, Context.METADATA, commandContext).isEmpty(); }
@Override public boolean hasRole(String roleName, CommandContext commandContext) { if (policyDecider == null) { return true; } return this.policyDecider.hasRole(roleName, commandContext); }
private void validateTemp(DataPolicy.PermissionType action, String resource, boolean schema, LanguageObject object, Context context) { Set<String> resources = Collections.singleton(resource); logRequest(resources, context); boolean allowed = decider.isTempAccessible(action, schema?resource:null, context, commandContext); logResult(resources, context, allowed); if (!allowed) { handleValidationError( QueryPlugin.Util.getString("ERR.018.005.0095", commandContext.getUserName(), "CREATE_TEMPORARY_TABLES"), //$NON-NLS-1$ //$NON-NLS-2$ Arrays.asList(object)); } }
TeiidComponentException { boolean modified = false; if (policyDecider != null && policyDecider.validateCommand(commandContext)) { if (ignoreUnathorizedInAsterisk(command, commandContext)) { Query query = (Query)command; Set<String> results = this.policyDecider.getInaccessibleResources(PermissionType.READ, map.keySet(), Context.QUERY, commandContext); if (!results.isEmpty()) {
/** * Out of the resources specified, return the subset for which the specified not have authorization to access. */ public Set<String> getInaccessibleResources(DataPolicy.PermissionType action, Set<String> resources, Context context) { logRequest(resources, context); Set<String> results = decider.getInaccessibleResources(action, resources, context, commandContext); logResult(resources, context, results.isEmpty()); return results; }
@Override public boolean hasRole(String roleName, CommandContext commandContext) { if (policyDecider == null) { return true; } return this.policyDecider.hasRole(roleName, commandContext); }
/** * Out of the resources specified, return the subset for which the specified not have authorization to access. */ public Set<String> getInaccessibleResources(DataPolicy.PermissionType action, Set<String> resources, Context context) { logRequest(resources, context); Set<String> results = decider.getInaccessibleResources(action, resources, context, commandContext); logResult(resources, context, results.isEmpty()); return results; }
/** * Out of the resources specified, return the subset for which the specified not have authorization to access. */ public Set<String> getInaccessibleResources(DataPolicy.PermissionType action, Set<String> resources, Context context) { logRequest(resources, context); Set<String> results = decider.getInaccessibleResources(action, resources, context, commandContext); logResult(resources, context, results.isEmpty()); return results; }