Help using Base SAS procedures

metadata repository rights

Not applicable
Posts: 0

metadata repository rights


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.
Super Contributor
Posts: 391

Re: metadata repository rights

Posted in reply to deleted_user
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

data library_act(keep=library_name ACT_name hasIdentity);
length lib_uri ACT_uri library_name ACT_name PT_uri $256;
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;

if ACT_name = '' then ACT_name = 'missing';
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
Not applicable
Posts: 0

Re: metadata repository rights

Posted in reply to deleted_user
Thank you FrederikE, i will try working with this tomorrow
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation