Help using Base SAS procedures

metadata repository rights

Reply
N/A
Posts: 0

metadata repository rights

Hello,

I was wondering if there was method to query the metadata to give me all users and their rights. From the metadata referenceguide and libname statement i can only extract my connections/rights. If someone can tell me how or point me to where i can read more on this I would appreciate it.
Frequent Contributor
Posts: 120

Re: metadata repository rights

Just some code to help you get in the right direction....
The following program makes a list of all libnames and which ACT that are connected to them:

options metaprotocol=bridge
metauser="USER"
metapass="PASSWORD"
metarepository="Foundation";

data library_act(keep=library_name ACT_name hasIdentity);
length lib_uri ACT_uri library_name ACT_name PT_uri $256;
nobj=0;
n = 1;
ACT_uri=''; lib_uri=''; PT_uri=''; library_name = '';
/* Determine how many SASLibrary objects are in this repository. */
nobj=metadata_getnobj("omsobjSmiley FrustratedASLibrary?@id contains '.'",n,lib_uri);
do until(nobj < 0);
/* Get libref attributes */
rc = metadata_getattr(lib_uri,"Name",library_name);
rc = metadata_getnasn(lib_uri,"AccessControls",1,ACT_uri);
ACT_name ='';
hasIdentity = 0;

if rc > 0 then do;
rc = metadata_getattr(ACT_uri,"Name",ACT_name);
rc1 = metadata_getnasn(ACT_uri,"Identities",1,PT_uri);
if rc1 > 0 then hasIdentity = 1;
rc1 = metadata_getnasn(ACT_uri,"AccessControlItems",1,PT_uri);
if rc1 > 0 then hasIdentity = 1;
end;

if ACT_name = '' then ACT_name = 'missing';
n=n+1;
output;
nobj=metadata_getnobj("omsobjSmiley FrustratedASLibrary?@Id contains '.'",n,lib_uri);
end; /* do until */
run; Metabrowse is very useful and you will find more datastep functions for reading metadata in SAS-documentation. You can also use xml to get the same result, i have not done that thou'


Message was edited by: FredrikE
N/A
Posts: 0

Re: metadata repository rights

Thank you FrederikE, i will try working with this tomorrow
Ask a Question
Discussion stats
  • 2 replies
  • 121 views
  • 0 likes
  • 2 in conversation