<?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: Programatically set library to readonly in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511194#M73050</link>
    <description>&lt;P&gt;It's not as simple as putting&amp;nbsp;&lt;EM&gt;access=readonly&lt;/EM&gt; on to the end of the&amp;nbsp;&lt;EM&gt;libname&lt;/EM&gt; statement, is it? I don't often (because I'm sadly in an environment where SAS metadata is scarcely used) use metadata libnames, but that's how I'd do it without metadata.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Nov 2018 20:50:58 GMT</pubDate>
    <dc:creator>LaurieF</dc:creator>
    <dc:date>2018-11-07T20:50:58Z</dc:date>
    <item>
      <title>Programatically set library to readonly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511159#M73047</link>
      <description>&lt;P&gt;I am working on a project to automate the creation of libraries on a metadata server.&amp;nbsp; Using methods like &lt;EM&gt;METADATA_NEWOBJ&lt;/EM&gt; and &lt;EM&gt;METADATA_SETATTR&lt;/EM&gt;, I am 95% there; the one thing I haven't been able to do is set the newly created library to be read-only.&amp;nbsp; Using Management Console we would do this by going to the advanced options and setting "Library access" to &lt;EM&gt;READONLY&lt;/EM&gt;; can this be accomplished directly from code?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 19:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511159#M73047</guid>
      <dc:creator>JayDZimmerman</dc:creator>
      <dc:date>2018-11-07T19:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically set library to readonly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511194#M73050</link>
      <description>&lt;P&gt;It's not as simple as putting&amp;nbsp;&lt;EM&gt;access=readonly&lt;/EM&gt; on to the end of the&amp;nbsp;&lt;EM&gt;libname&lt;/EM&gt; statement, is it? I don't often (because I'm sadly in an environment where SAS metadata is scarcely used) use metadata libnames, but that's how I'd do it without metadata.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 20:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511194#M73050</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2018-11-07T20:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically set library to readonly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511222#M73052</link>
      <description>&lt;P&gt;In our environment the users rely almost exclusively on the metadata information presented in Enterprise Guide; most of them have never seen a LIBNAME statement before.&amp;nbsp; Since we need the libraries to be protected from the moment the user connects from EG, we have to secure them in the metadata definitions.&amp;nbsp; Of course, I am always open to alternate ways to control access that can be handled programatically.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 22:39:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511222#M73052</guid>
      <dc:creator>JayDZimmerman</dc:creator>
      <dc:date>2018-11-07T22:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically set library to readonly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511226#M73053</link>
      <description>&lt;P&gt;My preference would be to have it done in metadata - so you don't have to worry about it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But a problem with EG is that someone can always access the path with their own libname statement, and I don't believe there's any way that can be stopped if their own access rights allow them to do it. So check their LDAP (or equivalent) permissions.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 22:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511226#M73053</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2018-11-07T22:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically set library to readonly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511235#M73055</link>
      <description>&lt;P&gt;You are absolutely correct about the user's ability to override the readonly flag.&amp;nbsp; We are relying upon the fact that most of our users don't know about libname statements and, even if they did, they don't know what the file system structure looks like.&amp;nbsp; Consequently, they can't construct the proper libname statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A gotcha with this situation is that we can't enforce the permissions at the file system or authorization level because we actually need the users to be able to alter the library contents in specific cases.&amp;nbsp; In those instances we obfuscate the functionality in compiled macros, internally using the reverse of your suggestion:&amp;nbsp; issue a libname statement granting write access, executing the appropriating updates, and issuing a second libname statement flipping back to readonly.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 23:06:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511235#M73055</guid>
      <dc:creator>JayDZimmerman</dc:creator>
      <dc:date>2018-11-07T23:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically set library to readonly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511237#M73056</link>
      <description>&lt;P&gt;Ah. Well. Hmm. If the modifications to the datasets were able to be made generic enough, you could encapsulate the libname re-setting to writable, the modification to the data and the re-re-setting in a macro with&amp;nbsp;&lt;EM&gt;options nomprint&lt;/EM&gt;, and teach them how to do it that way.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 23:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/511237#M73056</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2018-11-07T23:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Programatically set library to readonly</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/512662#M73100</link>
      <description>&lt;P&gt;After some help from SAS Technical Support and some manual poking around, I am posting a solution in case it can help someone else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA _null_;
    LENGTH luri puri pturi $256;
    CALL MISSING(luri, puri, pturi);
    rc=0;

    nobj=METADATA_GETNOBJ("omsobj:SASLibrary?@Name='MyTestLibrary'",1,luri);

    IF (nobj &amp;gt; 0) THEN DO;
        rc=METADATA_SETPROP(luri, "Library.SAS.Property.ACCESS.Name.xmlKey.txt", "READONLY", puri);
       	rc=METADATA_SETATTR(puri, "PropertyName", "ACCESS");
        rc=METADATA_SETATTR(puri, "Delimiter", "=");
        rc=METADATA_NEWOBJ("PropertyType", pturi, "ACCESS Types");
        rc=METADATA_SETASSN(puri, "OwningType", "Replace", pturi);
    END;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:43:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Programatically-set-library-to-readonly/m-p/512662#M73100</guid>
      <dc:creator>JayDZimmerman</dc:creator>
      <dc:date>2018-11-13T18:43:27Z</dc:date>
    </item>
  </channel>
</rss>

