Loading...
Searching...
No Matches
mpe_column_level_security_postedit.sas
Go to the documentation of this file.
1/**
2 @file
3 @brief Post Edit Hook script for the MPE_COLUMN_LEVEL_SECURITY table
4 @details Post edit hooks provide additional backend validation for user
5 provided data. The incoming dataset is named `work.staging_ds` and is
6 provided in mpe_loader.sas.
7
8 Available macro variables:
9 @li DC_LIBREF - The DC control library
10 @li LIBREF - The library of the dataset being edited (is assigned)
11 @li DS - The dataset being edited
12
13 This validation checks the incoming column_level_security settings to ensure
14 each individual filter is valid
15
16 Hook scripts run inside the service that includes them, so the macros
17 they call are already in that session. They are listed as ignored rather
18 than declared, so the script keeps no macro list of its own to maintain.
19
20 @sasjslint {"ignoredMacros": ["mp_abort"]}
21
22**/
23
24/* check scope values and ensure uppercasing */
25%let errflag=0;
26%let errmsg=;
27data work.staging_ds;
28 set work.staging_ds;
29 cls_scope=upcase(cls_scope);
30 CLS_LIBREF=upcase(CLS_LIBREF);
31 cls_table=upcase(CLS_TABLE);
32 CLS_VARIABLE_NM=upcase(CLS_VARIABLE_NM);
33
34 if cls_scope not in ('ALL','VIEW','EDIT') then do;
35 call symputx('errflag',1);
36 call symputx('errmsg',"Invalid scope: "!!cls_scope);
37 stop;
38 end;
39
40 if cls_hide<1 then cls_hide=0;
41 else cls_hide=1;
42 if CLS_ACTIVE<1 then CLS_ACTIVE=0;
43 else CLS_ACTIVE=1;
44
45run;
46
47%mp_abort(iftrue=(&errflag=1)
48 ,mac=mpe_column_level_security_postedit
49 ,msg=%superq(errmsg)
50)