mpe_security_postedit.sas
Go to the documentation of this file.
1 /**
2  @file
3  @brief Post Edit Hook script for the MPE_SECURITY table
4  @details Post edit hooks provide additional backend validation against
5  user-sourced data. The incoming dataset is always `work.staging_ds` and this
6  file is included from the mpe_loader.sas macro.
7 
8  Available (at runtime) macro variables:
9  @li DC_LIBREF - The DC control library for your site
10  @li LIBREF - The library of the dataset being edited (is assigned)
11  @li DS - The dataset being edited
12 
13 
14 **/
15 
16 /* ensure upcase and check access level values*/
17 %let errval=0;
18 %let errmsg=;
19 data work.staging_ds;
20  set work.staging_ds;
21  LIBREF=upcase(LIBREF);
22  DSN=upcase(DSN);
23  ACCESS_LEVEL=upcase(ACCESS_LEVEL);
24  if ACCESS_LEVEL not in ('EDIT','APPROVE','VIEW','SIGNOFF','AUDIT') then do;
25  putlog "ERR" +(-1) "OR: invalid ACCESS_LEVEL - " access_level;
26  call symputx('errval',1);
27  call symputx('errmsg',"Invalid ACCESS_LEVEL: "!!access_level);
28  end;
29 run;
30 
31 %mp_abort(iftrue=(&errval=1)
32  ,mac=mpe_security_postedit.sas
33  ,msg=%str(&errmsg)
34 )