<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get authorization level from library tables in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/586929#M34607</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;How can i get the names of the tables from a library...."&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let lref=sashelp;
proc sql;
/*  create table want as*/
  select *
  from dictionary.tables
  where libname="%upcase(&amp;amp;lref)"
  order by memname
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;"....&lt;SPAN&gt;and the authorization group level that each table has"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That depends. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- If it's physical SAS tables then security is applied on OS level on folder and files and you would have to query the OS plus eventually AD/LDAP to retrieve such information. That could become quite intense.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- If it's a database then you need to retrieve this information from some database system tables&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- If it's SAS Metadata then you also need to query the SAS Metadata Repository as for such tables who gets access can be a combination of SAS Metadata and OS level or database security.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not an admin then also be aware that your user might not have the necessary privileges to retrieve such security information from the OS/LDAP/AD or a database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Sep 2019 01:42:01 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-09-07T01:42:01Z</dc:date>
    <item>
      <title>Get authorization level from library tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/586925#M34606</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i get the names of the tables from a library and the authorization group level that each table has ?&lt;/P&gt;&lt;P&gt;for example i have the "customer" table and this table can only be read by "group 1" and other table can only be read by "group 2" ......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 01:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/586925#M34606</guid>
      <dc:creator>Jose6</dc:creator>
      <dc:date>2019-09-07T01:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get authorization level from library tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/586929#M34607</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;How can i get the names of the tables from a library...."&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let lref=sashelp;
proc sql;
/*  create table want as*/
  select *
  from dictionary.tables
  where libname="%upcase(&amp;amp;lref)"
  order by memname
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;"....&lt;SPAN&gt;and the authorization group level that each table has"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That depends. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- If it's physical SAS tables then security is applied on OS level on folder and files and you would have to query the OS plus eventually AD/LDAP to retrieve such information. That could become quite intense.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- If it's a database then you need to retrieve this information from some database system tables&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;- If it's SAS Metadata then you also need to query the SAS Metadata Repository as for such tables who gets access can be a combination of SAS Metadata and OS level or database security.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not an admin then also be aware that your user might not have the necessary privileges to retrieve such security information from the OS/LDAP/AD or a database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Sep 2019 01:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/586929#M34607</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-07T01:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get authorization level from library tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/587394#M34615</link>
      <description>&lt;P&gt;Thanks Patrick, in this case i want the authorization level assigned in metadata by management console for each table.&lt;/P&gt;&lt;P&gt;A few days ago i found this query to obtain the user en its group level and now instead of the user i want the tables&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data users_grps;&lt;BR /&gt;&lt;BR /&gt;/* The LENGTH statement defines variables for function arguments and&lt;BR /&gt;assigns the maximum length of each variable. */&lt;BR /&gt;&lt;BR /&gt;length uri name dispname group groupuri $256&lt;BR /&gt;id MDUpdate $20;&lt;BR /&gt;&lt;BR /&gt;/* The CALL MISSING routine initializes output variables to missing values.*/&lt;BR /&gt;&lt;BR /&gt;n=1;&lt;BR /&gt;call missing(uri, name, dispname, group, groupuri, id, MDUpdate);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* The METADATA_GETNOBJ function specifies to get the Person objects&lt;BR /&gt;in the repository. The n argument specifies to get the first Person object that is&lt;BR /&gt;returned. The uri argument will return the actual uri of the Person object that&lt;BR /&gt;is returned. The program prints an informational message if no Person objects&lt;BR /&gt;are found. */&lt;BR /&gt;&lt;BR /&gt;nobj=metadata_getnobj("omsobj:Person?@Id contains '.'",n,uri);&lt;BR /&gt;if nobj=0 then put 'No Persons available.';&lt;BR /&gt;&lt;BR /&gt;/* The DO statement specifies a group of statements to be executed as a unit&lt;BR /&gt;for the Person object that is returned by METADATA_GETNOBJ. The METADATA_GETATTR&lt;BR /&gt;function gets the values of the object's Name and DisplayName attributes. */&lt;BR /&gt;&lt;BR /&gt;else do while (nobj &amp;gt; 0);&lt;BR /&gt;rc=metadata_getattr(uri, "Name", Name);&lt;BR /&gt;rc=metadata_getattr(uri, "DisplayName", DispName);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/* The METADATA_GETNASN function gets objects associated via the IdentityGroups&lt;BR /&gt;association. The a argument specifies to return the first associated object for&lt;BR /&gt;that association type. The URI of the associated object is returned in the&lt;BR /&gt;groupuri variable. */&lt;BR /&gt;&lt;BR /&gt;a=1;&lt;BR /&gt;grpassn=metadata_getnasn(uri,"IdentityGroups",a,groupuri);&lt;BR /&gt;&lt;BR /&gt;/* If a person does not belong to any groups, set their group&lt;BR /&gt;variable to 'No groups' and output their name. */&lt;BR /&gt;&lt;BR /&gt;if grpassn in (-3,-4) then do;&lt;BR /&gt;group="No groups";&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;/* If the person belongs to many groups, loop through the list&lt;BR /&gt;and retrieve the Name and MetadataUpdated attributes of each group,&lt;BR /&gt;outputting each on a separate record. */&lt;BR /&gt;&lt;BR /&gt;else do while (grpassn &amp;gt; 0);&lt;BR /&gt;rc2=metadata_getattr(groupuri, "Name", group);&lt;BR /&gt;rc=metadata_getattr(groupuri, "MetadataUpdated", MDUpdate);&lt;BR /&gt;a+1;&lt;BR /&gt;output;&lt;BR /&gt;grpassn=metadata_getnasn(uri,"IdentityGroups",a,groupuri);&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;/* Retrieve the next person's information */&lt;BR /&gt;&lt;BR /&gt;n+1;&lt;BR /&gt;nobj=metadata_getnobj("omsobj:Person?@Id contains '.'",n,uri);&lt;BR /&gt;end;&lt;BR /&gt;&lt;BR /&gt;/* The KEEP statement specifies the variables to include in the output data set. */&lt;BR /&gt;&lt;BR /&gt;keep name dispname MDUpdate group;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;/* Display the list of users and their groups */&lt;BR /&gt;proc report data=users_grps nowd headline headskip;&lt;BR /&gt;columns name dispname group MDUpdate;&lt;BR /&gt;define name / order 'User Name' format=$30.;&lt;BR /&gt;define dispname / order 'Display Name' format=$30.;&lt;BR /&gt;define group / order 'Group' format=$30.;&lt;BR /&gt;define MDUpdate / display 'Updated' format=$20.;&lt;BR /&gt;break after name / skip;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 01:20:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/587394#M34615</guid>
      <dc:creator>Jose6</dc:creator>
      <dc:date>2019-09-10T01:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get authorization level from library tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/587410#M34616</link>
      <description>&lt;P&gt;I don't have ready-made code available for what you're after but the SAS provided %mdsecds() macro should give you a good starting point.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=n0l1mpdt430djgn1bl1c3euei85w.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p1c938it9pojnen1vwjal9cans9z"&gt;https://go.documentation.sas.com/?docsetId=bisecag&amp;amp;docsetTarget=n0l1mpdt430djgn1bl1c3euei85w.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p1c938it9pojnen1vwjal9cans9z&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are aware that if you don't have a metadata-bound library then querying the metadata alone will only tell you who can access registered table metadata objects. It won't tell you if such users also have the necessary privileges to access the underlying physical data when using the metadata objects nor will it tell you who else can use SAS to access the physical data simply by issuing a libname statement in code.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 03:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/587410#M34616</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-10T03:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get authorization level from library tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/587704#M34627</link>
      <description>&lt;P&gt;Thks for the link patrick, it's a great help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 00:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Get-authorization-level-from-library-tables/m-p/587704#M34627</guid>
      <dc:creator>Jose6</dc:creator>
      <dc:date>2019-09-11T00:15:21Z</dc:date>
    </item>
  </channel>
</rss>

