1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-07 01:20:05 +00:00

feat: enabling user list by group id as well as name

This commit is contained in:
Allan Bowe
2022-06-17 07:16:57 +00:00
parent ed19ee03af
commit 1eb6d8cec9
2 changed files with 22 additions and 12 deletions

View File

@@ -8,12 +8,17 @@
%ms_getusers(outds=userlist)
Filtering for a group:
Filtering for a group by group name:
%ms_getusers(outds=work.groupmembers, group=GROUPNAME)
Filtering for a group by group id:
%ms_getusers(outds=work.groupmembers, gid=1)
@param [in] mdebug= (0) Set to 1 to enable DEBUG messages
@param [in] group= (0) Set to a group name to filter members for that group
@param [in] gid= (0) Set to a group id to filter members for that group
@param [out] outds= (work.ms_getusers) This output dataset will contain the
list of user accounts. Format:
|DISPLAYNAME:$60.|USERNAME:$30.|ID:best.|
@@ -25,7 +30,6 @@
|`New User `|`newuser `|`5`|
<h4> SAS Macros </h4>
@li mf_getuniquefileref.sas
@li mf_getuniquelibref.sas
@@ -41,6 +45,7 @@
%macro ms_getusers(
outds=work.ms_getusers,
group=0,
gid=0,
mdebug=0
);
@@ -75,9 +80,9 @@ run;
run;
%end;
%if "&group"="0" %then %let url=/SASjsApi/user;
%else %let url=/SASjsApi/group/by/groupname/&group;
%if "&group" ne "0" %then %let url=/SASjsApi/group/by/groupname/&group;
%else %if "&gid" ne "0" %then %let url=/SASjsApi/group/&gid;
%else %let url=/SASjsApi/user;
proc http method='GET' headerin=&fref0 out=&fref1
url="&_sasjs_apiserverurl.&url";
@@ -95,7 +100,7 @@ run;
libname &libref JSON fileref=&fref1;
%if "&group"="0" %then %do;
%if "&group"="0" and "&gid"="0" %then %do;
data &outds;
length DISPLAYNAME $60 USERNAME:$30 ID 8;
set &libref..root;