사용자는 메타 데이터를 쿼리하기 위해 관리자 일 필요는 없습니다. 메타 데이터 객체에 대한 읽기 권한이 있어야합니다. 나는 우리의 서버에서 바로 사용자입니다, 나는 http://support.sas.com/kb/30/682.html의 적응 사용하여 사용자 및 관련 그룹 모두의 목록을 얻을 수 있습니다 :
data users_grps (keep=name group email);
length uri name groupuri group emailuri email $256 ;
call missing(uri, name, groupuri, group, emailuri, email) ;
/* Get URI of first person */
n=1;
nobj=metadata_getnobj("omsobj:[email protected] contains '.'",n,uri);
if nobj=0 then put 'No Persons available.';
do while (nobj > 0);
call missing(name, groupuri, group, emailuri, email) ;
/* Retrieve the current persons name. */
rc=metadata_getattr(uri, "Name", Name);
/* get the persons email address (only first one)*/
rc2=metadata_getnasn(uri,"EmailAddresses",1,emailURI) ;
rc3=metadata_getattr(emailuri, "Address", email);
/* Get the group association information for the current person. */
a=1;
rcgrp=metadata_getnasn(uri,"IdentityGroups",a,groupuri);
/* If this person does not belong to any groups, set their group */
/* variable to 'No groups' and output the name. */
if rcgrp in (-3,-4) then do;
group="No groups";
output;
end;
/* If the person belongs to any groups, loop through the list */
/* and retrieve the name of each group, outputting each on a */
/* separate record. */
else do while (rcgrp > 0);
rc4=metadata_getattr(groupuri, "Name", group);
a+1;
output;
rcgrp=metadata_getnasn(uri,"IdentityGroups",a,groupuri);
end;
/* Get URI of next person. */
n+1;
nobj=metadata_getnobj("omsobj:[email protected] contains '.'",n,uri);
end;
run;
가의 그룹을 찾기 위해 적용 할 수있는 생각겠습니까을 현재 사용자.