killbill-uncached

payment: add missing tenant checks This fixes https://github.com/killbill/killbill/issues/447. Verified

12/7/2015 11:35:53 AM

Details

diff --git a/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentMethodSqlDao.sql.stg b/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentMethodSqlDao.sql.stg
index b5af8b3..210d6da 100644
--- a/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentMethodSqlDao.sql.stg
+++ b/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentMethodSqlDao.sql.stg
@@ -71,6 +71,7 @@ getPaymentMethodIncludedDelete(accountId) ::= <<
 select <allTableFields()>
 from <tableName()>
 where id = :id
+<AND_CHECK_TENANT()>
 ;
 >>
 
@@ -80,6 +81,7 @@ select
 from <tableName()>
 where account_id = :accountId
 and is_active = true
+<AND_CHECK_TENANT()>
 ;
 >>
 
@@ -88,6 +90,7 @@ select
 <allTableFields()>
 from <tableName()>
 where account_id = :accountId
+<AND_CHECK_TENANT()>
 ;
 >>
 
@@ -104,6 +107,7 @@ select
 from <tableName()> t
 where t.plugin_name = :pluginName
 and t.is_active = true
+<AND_CHECK_TENANT("t.")>
 order by t.record_id
 limit :rowCount offset :offset
 ;
@@ -115,5 +119,6 @@ select
 from <tableName()> t
 where t.plugin_name = :pluginName
 and t.is_active = true
+<AND_CHECK_TENANT("t.")>
 ;
 >>
diff --git a/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentSqlDao.sql.stg b/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentSqlDao.sql.stg
index ea1de08..5b4ff43 100644
--- a/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentSqlDao.sql.stg
+++ b/payment/src/main/resources/org/killbill/billing/payment/dao/PaymentSqlDao.sql.stg
@@ -71,6 +71,7 @@ select
 <allTableFields("")>
 from <tableName()>
 where external_key = :externalKey
+<AND_CHECK_TENANT()>
 ;
 >>
 
@@ -88,6 +89,7 @@ select
 from <tableName()> t
 join payment_methods pm on pm.id = t.payment_method_id
 where pm.plugin_name = :pluginName
+<AND_CHECK_TENANT("t.")>
 order by t.record_id asc
 limit :rowCount offset :offset
 ;
@@ -99,6 +101,7 @@ select
 from <tableName()> t
 join payment_methods pm on pm.id = t.payment_method_id
 where pm.plugin_name = :pluginName
+<AND_CHECK_TENANT("t.")>
 ;
 >>