Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save forstie/b8105c4b1bce271c1a9abde39141b6b6 to your computer and use it in GitHub Desktop.
Save forstie/b8105c4b1bce271c1a9abde39141b6b6 to your computer and use it in GitHub Desktop.
Row permissions control for ZDA access
--
-- description: This row permission can be used to disallow specific jobnames from selecting
-- data over a specific file
--
cl:CHGFCNUSG FCNID(QIBM_DB_SECADM) USER(SCOTTF) USAGE(*ALLOWED); -- repeat this on the target (not yet mirrored)
set schema star1g ;
set path star1g ;
create table RowPermRules (
jobname varchar(10),
fetch_not_permitted integer
);
insert into RowPermRules
values('QZDASOINIT', 1), ('QZDASSINIT', 1);
create or replace permission SlowDownOdbc on Item_Fact
for rows where 0 = (select count(*) from RowPermRules
where jobname = right(qsys2.job_name,10)
and fetch_not_permitted = 1)
enforced for all access
enable;
alter table Item_Fact activate row access control;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment