code: private void validateAccess(
  		SqlNode node,
  		SqlValidatorTable table,
  		SqlAccessEnum requiredAccess) {
  		if (table != null) {
  			SqlAccessType access = table.getAllowedAccess();
  			if (!access.allowsAccess(requiredAccess)) {
  				throw newValidationError(node,
  					RESOURCE.accessNotAllowed(requiredAccess.name(),
  						table.getQualifiedName().toString()));
  			}
  		}
  	}
docs: Validates access to a table.
  
  @param table          Table
  @param requiredAccess Access requested on table