From: KaiGai Kohei on
The attached patch tries to rework DML permission checks.

It was mainly checked at the ExecCheckRTEPerms(), but same logic was
implemented in COPY TO/FROM statement and RI_Initial_Check().

This patch tries to consolidate these permission checks into a common
function to make access control decision on DML permissions. It enables
to eliminate the code duplication, and improve consistency of access
controls.

Thanks,
--
KaiGai Kohei <kaigai(a)ak.jp.nec.com>