@sasjs/core 4.29.0 → 4.30.2
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/base/mp_abort.sas +2 -2
- package/package.json +1 -1
- package/server/ms_getgroups.sas +12 -4
- package/server/ms_getusers.sas +13 -0
package/base/mp_abort.sas
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
%if %symexist(_SYSINCLUDEFILEDEVICE)
|
|
76
76
|
/* abort cancel FILE does not restart outside the INCLUDE on Viya 3.5 */
|
|
77
|
-
and
|
|
77
|
+
and %str(&SYSPROCESSNAME) ne %str(Compute Server)
|
|
78
78
|
%then %do;
|
|
79
79
|
%if "*&_SYSINCLUDEFILEDEVICE*" ne "**" %then %do;
|
|
80
80
|
data &errds;
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
/* Web App Context */
|
|
94
94
|
%if %symexist(_PROGRAM)
|
|
95
|
-
or
|
|
95
|
+
or %str(&SYSPROCESSNAME) = %str(Compute Server)
|
|
96
96
|
or &mode=INCLUDE
|
|
97
97
|
%then %do;
|
|
98
98
|
options obs=max replace mprint;
|
package/package.json
CHANGED
package/server/ms_getgroups.sas
CHANGED
|
@@ -9,12 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
%ms_getgroups(outds=userlist)
|
|
11
11
|
|
|
12
|
-
With filter:
|
|
12
|
+
With filter on username:
|
|
13
13
|
|
|
14
14
|
%ms_getgroups(outds=userlist, user=James)
|
|
15
15
|
|
|
16
|
+
With filter on userid:
|
|
17
|
+
|
|
18
|
+
%ms_getgroups(outds=userlist, uid=1)
|
|
19
|
+
|
|
16
20
|
@param [in] mdebug= (0) Set to 1 to enable DEBUG messages
|
|
17
21
|
@param [in] user= (0) Provide the username on which to filter
|
|
22
|
+
@param [in] uid= (0) Provide the userid on which to filter
|
|
18
23
|
@param [out] outds= (work.ms_getgroups) This output dataset will contain the
|
|
19
24
|
list of groups. Format:
|
|
20
25
|
|NAME:$32.|DESCRIPTION:$64.|GROUPID:best.|
|
|
@@ -37,6 +42,7 @@
|
|
|
37
42
|
|
|
38
43
|
%macro ms_getgroups(
|
|
39
44
|
user=0,
|
|
45
|
+
uid=0,
|
|
40
46
|
outds=work.ms_getgroups,
|
|
41
47
|
mdebug=0
|
|
42
48
|
);
|
|
@@ -86,8 +92,10 @@ run;
|
|
|
86
92
|
run;
|
|
87
93
|
%end;
|
|
88
94
|
|
|
89
|
-
%if "&user"
|
|
90
|
-
%else %let url=/SASjsApi/user
|
|
95
|
+
%if "&user" ne "0" %then %let url=/SASjsApi/user/by/username/&user;
|
|
96
|
+
%else %if "&uid" ne "0" %then %let url=/SASjsApi/user/&uid;
|
|
97
|
+
%else %let url=/SASjsApi/group;
|
|
98
|
+
|
|
91
99
|
|
|
92
100
|
proc http method='GET' headerin=&fref0 out=&fref1
|
|
93
101
|
url="&_sasjs_apiserverurl.&url";
|
|
@@ -104,7 +112,7 @@ run;
|
|
|
104
112
|
|
|
105
113
|
libname &libref JSON fileref=&fref1;
|
|
106
114
|
|
|
107
|
-
%if "&user"="0" %then %do;
|
|
115
|
+
%if "&user"="0" and "&uid"="0" %then %do;
|
|
108
116
|
data &outds;
|
|
109
117
|
length NAME $32 DESCRIPTION $64. GROUPID 8;
|
|
110
118
|
if _n_=1 then call missing(of _all_);
|
package/server/ms_getusers.sas
CHANGED
|
@@ -60,6 +60,19 @@
|
|
|
60
60
|
%let fref1=%mf_getuniquefileref();
|
|
61
61
|
%let libref=%mf_getuniquelibref();
|
|
62
62
|
|
|
63
|
+
%if %sysget(MODE)=desktop %then %do;
|
|
64
|
+
/* users api does not exist in desktop mode */
|
|
65
|
+
data &outds;
|
|
66
|
+
length DISPLAYNAME $60 USERNAME:$30 ID 8;
|
|
67
|
+
USERNAME="&sysuserid";
|
|
68
|
+
DISPLAYNAME="&sysuserid (desktop mode)";
|
|
69
|
+
ID=1;
|
|
70
|
+
output;
|
|
71
|
+
stop;
|
|
72
|
+
run;
|
|
73
|
+
%return;
|
|
74
|
+
%end;
|
|
75
|
+
|
|
63
76
|
/* avoid sending bom marker to API */
|
|
64
77
|
%let optval=%sysfunc(getoption(bomfile));
|
|
65
78
|
options nobomfile;
|