chore: Re-basing file due to merge conflict
This commit is contained in:
@@ -39,15 +39,35 @@
|
||||
%let &outresult=NO;
|
||||
%let &outreason=NOTFOUND;
|
||||
|
||||
/* check if there is actually a version to restore */
|
||||
%local libds;
|
||||
proc sql noprint;
|
||||
select upcase(cats(base_lib,'.',base_ds)) into: libds
|
||||
from &dc_libref..mpe_submit
|
||||
where TABLE_ID="&load_ref";
|
||||
|
||||
/**
|
||||
* check if there is actually a version to restore
|
||||
*/
|
||||
%local audtab;
|
||||
proc sql noprint;
|
||||
select coalescec(audit_libds,"&dc_libref..MPE_AUDIT") into: audtab
|
||||
from &dclib..MPE_TABLES
|
||||
where &dc_dttmtfmt. lt tx_to
|
||||
and libref="%scan(&libds,1,.)" and dsn="%scan(&libds,2,.)";
|
||||
%if "&audtab"="0" %then %do;
|
||||
%let allow_restore=NO;
|
||||
%let reason= &libds has no audit table configured;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
%local chk;
|
||||
%let chk=0;
|
||||
proc sql noprint;
|
||||
select count(*) into: chk from &dc_libref..mpe_audit
|
||||
select count(*) into: chk from &audtab
|
||||
where load_ref="&load_ref";
|
||||
%if &chk=0 %then %do;
|
||||
%let &outresult=NO;
|
||||
%let &outreason=No entry for &load_ref in MPE_AUDIT;
|
||||
%let allow_restore=NO;
|
||||
%let reason=No entry for &load_ref in &audtab;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
@@ -64,24 +84,19 @@
|
||||
where groupname="&dc_admin_group";
|
||||
|
||||
%if &is_admin>0 %then %do;
|
||||
%let &outresult=YES;
|
||||
%let &outreason=IS ADMIN;
|
||||
%let allow_restore=YES;
|
||||
%let reason=IS ADMIN;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
/* check if user has basic access */
|
||||
%local libds;
|
||||
proc sql noprint;
|
||||
select cats(base_lib,'.',base_ds) into: libds
|
||||
from &mpelib..mpe_submit
|
||||
where TABLE_ID="&load_ref";
|
||||
%mpe_accesscheck(&libds,outds=work.access_check
|
||||
,user=&user
|
||||
,access_level=EDIT
|
||||
)
|
||||
%if %mf_nobs(access_check)=0 %then %do;
|
||||
%let &outresult=NO;
|
||||
%let &outreason=No access in MPE_TABLES;
|
||||
%let allow_restore=NO;
|
||||
%let reason=No access in MPE_TABLES;
|
||||
%return;
|
||||
%end;
|
||||
|
||||
@@ -97,8 +112,8 @@
|
||||
and CLS_LIBREF="%upcase(&base_lib)"
|
||||
and CLS_TABLE="%upcase(&base_ds)";
|
||||
%if %mf_nobs(work.cls_rules)>0 %then %do;
|
||||
%let &outresult=NO;
|
||||
%let &outreason=User has restrictions in MPE_COLUMN_LEVEL_SECURITY;
|
||||
%let allow_restore=NO;
|
||||
%let reason=User has restrictions in MPE_COLUMN_LEVEL_SECURITY;
|
||||
data _null_;
|
||||
set work.cls_rules;
|
||||
putlog (_all_)(=);
|
||||
@@ -119,8 +134,8 @@
|
||||
and rls_table="&base_ds"
|
||||
and rls_active=1;
|
||||
%if %mf_nobs(work.rls_rules)>0 %then %do;
|
||||
%let &outresult=NO;
|
||||
%let &outreason=User has restrictions in MPE_ROW_LEVEL_SECURITY;
|
||||
%let allow_restore=NO;
|
||||
%let reason=User has restrictions in MPE_ROW_LEVEL_SECURITY;
|
||||
data _null_;
|
||||
set work.rls_rules;
|
||||
putlog (_all_)(=);
|
||||
@@ -129,7 +144,7 @@
|
||||
%return;
|
||||
%end;
|
||||
%else %do;
|
||||
%let &outresult=YES;
|
||||
%let &outreason=CHECKS PASSED;
|
||||
%let allow_restore=YES;
|
||||
%let reason=CHECKS PASSED;
|
||||
%end;
|
||||
%mend mpe_checkrestore;
|
||||
%mend mpe_checkrestore;
|
||||
Reference in New Issue
Block a user