metadata server that contains the Folder information

Reply
SAS Employee
Posts: 3

metadata server that contains the Folder information

Hello

 

Its nice to be here for the first time.  Please help I need a Guide Code just like 

MEtaData Server that contains the user information (http://support.sas.com/kb/30/682.html), BUT that I can see folder information on metadata

 

 I mean need to get a list of folders with respective groups authorizations

 

Image1.png: From Metadata Server.

 

Thanks for your time.

 

greetings

 

Luis Manrique

SaS Consultor

 


Image1.PNG
Esteemed Advisor
Posts: 5,202

Re: metadata server that contains the Folder information

An alternative to do the work yourself is to explore the SMC plugin from Metacoda.
Data never sleeps
Regular Contributor
Posts: 236

Re: metadata server that contains the Folder information

options metaserver=metadata_server_name.IP_address /* network name/address of the metadata server, */
                                                   /* for example, metaserver=d441.na.sas.com) */
                                        
        metaport=8561               /* The port on which the metadata server is listening. */

        metauser="metadata\userid"  /* The domain-qualified user ID for the connection to */
                                    /* the metadata server. */

        metapass="password"         /* Password for the METAUSER= user ID. */
 
        metaprotocol=bridge         /* Protocol for the metadata server. */  

        metarepository=Foundation;  /* The default location of the user information that */
                                    /* is in the foundation repository. */

data folders;
   length uri Folder group groupuri $256 id $20;
  
       /* Initialize variables to missing. */
   n=1;
   uri='';
   Folder='';
   
  
       /* Determine how many person objects are defined. */
   nobj=metadata_getnobj("omsobj:Tree?@Name contains ''",n,uri);
   if nobj=0 then put 'No folders available.';

   else do while (nobj > 0);

         /* Retrieve the current person's name. */
      rc=metadata_getattr(uri, "Name", Folder);

	      n+1;
      nobj=metadata_getnobj("omsobj:Tree?@Name contains ''",n,uri);
	  output;
   end;
  keep Folder ;
run

In the above you can get list of folder name only. 

SAS Employee
Posts: 3

Re: metadata server that contains the Folder information

Hello Thanks for your answer.

 

That helps a lot. Maybe do you know wich variable do I need for listing Authorizations Groups on this function or maybe Do I need to use a different function.

 

Because this function gets me Groups, but I need Authorization (authorization.png)

 

grpassn=metadata_getnasn(uri,"IdentityGroups",a,groupuri);

 

If you know I will appreciate

 

Thanks

 


authorization.PNG
Super User
Posts: 1,231

Re: metadata server that contains the Folder information

Thanks @LinusH for mentioning Metacoda Plug-ins and thanks @LuisMan for requesting an evaluation.

 

I thought I'd let Luis (and others interested in this topic) know a little bit about how the Metacoda Identity Permissions Explorer and Metacoda Object Permissions Explorer provide an extremely quick way to get a effective permissions list of what a user/group has access to or what users/group who have access to a SAS metadata object. These plug-ins show the end result of all the applied ACTs and ACEs - essentially the end result and what you would otherwise need to determine by clicking on many Authorizations tabs.

 

Once you can see who has access within the Explorer plug-in, you can produce a HTML report which our customers find very useful for auditing purposes. I spoke about this at a SAS Banking 5-50 webinar last year and you can see the panel discussion and demonstrations at the on-demand webinar at https://www.metacoda.com/en/2016/07/embark-security-journey-metacoda/

 

If you'd like some product information on these plug-ins, they can be found at https://www.metacoda.com/en/products/security-plug-ins/ and there is some technical information on how the interface works at https://platformadmin.com/blogs/paul/2012/04/effective-permissions-explorers-sneak-peek/

 

Kind Regards,

Michelle

Respected Advisor
Posts: 3,841

Re: metadata server that contains the Folder information

The Metacoda plug-in provides the most versatile and easy to use option and is certainly worth investigating. In case you can't get access to it then also investigate what the OOTB security report macros could do for you.

 

Security Report Macros

http://support.sas.com/documentation/cdl/en/bisecag/69827/HTML/default/viewer.htm#p1h2c11fxfn6xcn1gq...

Regular Contributor
Posts: 236

Re: metadata server that contains the Folder information

You can try the below code. It is not tested but it should work. I have used metasec_getnauth function. There are separate function  for metadata security.

options metaserver=metadata_server_name.IP_address /* network name/address of the metadata server, */
                                                   /* for example, metaserver=d441.na.sas.com) */
                                        
        metaport=8561               /* The port on which the metadata server is listening. */

        metauser="metadata\userid"  /* The domain-qualified user ID for the connection to */
                                    /* the metadata server. */

        metapass="password"         /* Password for the METAUSER= user ID. */
 
        metaprotocol=bridge         /* Protocol for the metadata server. */  

        metarepository=Foundation;  /* The default location of the user information that */
                                    /* is in the foundation repository. */

data folders;
   length uri Folder group groupuri $256 id $20;
   length tc type name auth perm cond $20;
  
       /* Initialize variables to missing. */
   n=1;
   uri='';
   Folder='';
   
  
       /* Determine how many person objects are defined. */
   nobj=metadata_getnobj("omsobj:Tree?@Name contains ''",n,uri);
   if nobj=0 then put 'No folders available.';

   else do while (nobj > 0);

         /* Retrieve the current person's name. */
      rc=metadata_getattr(uri, "Name", Folder);

	      n+1;
      nobj=metadata_getnobj("omsobj:Tree?@Name contains ''",n,uri);
     
	n_auth=1;
	rc_auth=metasec_getnauth(tc,uri,n_auth,type,name,auth,perm,cond);
		do while (rc_auth=0);
		rc_auth=metasec_getnauth(tc,uri,n_auth,type,name,auth,perm,cond);
		n_auth+1; 
		output;
		end;
	
   end;
  keep Folder type name perm ;
run;
SAS Employee
Posts: 3

Re: metadata server that contains the Folder information

Hello thank you for your answer.

 

Script works, BUT just give me one group of the folder,if folder has more than one group does not show on the output

 

something like this is missing but i could no performe for folders, this is from person example

 

/* If this person does not belong to any groups, set their group */
/* variable to 'No groups' and output the name. */
if grpassn 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 (grpassn > 0);
rc2=metadata_getattr(groupuri, "Name", group);
a+1;
output;
grpassn=metadata_getnasn(uri,"IdentityGroups",a,groupuri);
end;

 

Thanks for your help

Ask a Question
Discussion stats
  • 7 replies
  • 148 views
  • 5 likes
  • 5 in conversation