@sasjs/core 4.49.1 → 4.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@sasjs/cli": "^4.4.1"
37
37
  },
38
- "version": "4.49.1"
38
+ "version": "4.50.0"
39
39
  }
@@ -0,0 +1,83 @@
1
+ /**
2
+ @file
3
+ @brief Fetches all groups or the groups for a particular member
4
+ @details When building applications that run on multiple flavours of SAS, it
5
+ is convenient to use a single macro (like this one) to fetch the groups
6
+ regardless of the flavour of SAS being used
7
+
8
+ The alternative would be to compile a generic macro in target-specific
9
+ folders (SASVIYA, SAS9 and SASJS). This avoids compiling unnecessary macros
10
+ at the expense of a more complex sasjsconfig.json setup.
11
+
12
+
13
+ @param [in] mdebug= (0) Set to 1 to enable DEBUG messages
14
+ @param [in] user= (0) Provide the username on which to filter
15
+ @param [in] uid= (0) Provide the userid on which to filter
16
+ @param [in] repo= (foundation) SAS9 only, choose the metadata repo to query
17
+ @param [in] access_token_var= (ACCESS_TOKEN) VIYA only.
18
+ The global macro variable to contain the access token
19
+ @param [in] grant_type= (sas_services) VIYA only.
20
+ Valid values are "password" or "authorization_code" (unquoted).
21
+ @param [out] outds= (work.mx_getgroups) This output dataset will contain the
22
+ list of groups. Format:
23
+ |NAME:$32.|DESCRIPTION:$256.|GROUPID:best.|
24
+ |---|---|---|
25
+ |`SomeGroup `|`A group `|`1`|
26
+ |`Another Group`|`this is a different group`|`2`|
27
+ |`admin`|`Administrators `|`3`|
28
+
29
+ <h4> SAS Macros </h4>
30
+ @li mf_getplatform.sas
31
+ @li mm_getgroups.sas
32
+ @li ms_getgroups.sas
33
+ @li mv_getgroups.sas
34
+ @li mv_getusergroups.sas
35
+
36
+ **/
37
+
38
+ %macro mx_getgroups(
39
+ mdebug=0,
40
+ user=0,
41
+ uid=0,
42
+ repo=foundation,
43
+ access_token_var=ACCESS_TOKEN,
44
+ grant_type=sas_services,
45
+ outds=work.mx_getgroups
46
+ )/*/STORE SOURCE*/;
47
+ %local platform name shortloc;
48
+ %let platform=%mf_getplatform();
49
+
50
+ %if &platform=SASJS %then %do;
51
+ %ms_getgroups(
52
+ user=&user,
53
+ uid=&uid,
54
+ outds=&outds,
55
+ mdebug=&mdebug
56
+ )
57
+ %end;
58
+ %else %if &platform=SAS9 or &platform=SASMETA %then %do;
59
+ %if &user=0 %then %let user=;
60
+ %mm_getGroups(
61
+ user=&user
62
+ ,outds=&outds
63
+ ,repo=&repo
64
+ ,mDebug=&mdebug
65
+ )
66
+ %end;
67
+ %else %if &platform=SASVIYA %then %do;
68
+ %if &user=0 %then %do;
69
+ %mv_getgroups(access_token_var=&access_token_var
70
+ ,grant_type=&grant_type
71
+ ,outds=&outds
72
+ )
73
+ %end;
74
+ %else %do;
75
+ %mv_getusergroups(&user
76
+ ,outds=&outds
77
+ ,access_token_var=&access_token_var
78
+ ,grant_type=&grant_type
79
+ )
80
+ %end;
81
+ %end;
82
+
83
+ %mend mx_getgroups;