<?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 Prevent Studio users from accessing custom Compute Context in SAS Viya</title>
    <link>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/985719#M3051</link>
    <description>&lt;P&gt;We have a web application that makes use of a custom Compute Context with a dedicated system account (SYSUSERID).&amp;nbsp; &amp;nbsp; Similar to a Stored Process context in SAS 9.&lt;BR /&gt;&lt;BR /&gt;The problem is that end users are able to select that context in other Viya applications, such as SAS Studio, and hence run their own code using that SYSUSERID.&lt;BR /&gt;&lt;BR /&gt;For a batch job, you would simply restrict which users can access the context.&amp;nbsp; But in this case, we need the end users to be able to access the context, albeit only for Jobs within a particular Viya Folder.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Is there any way to restrict access to a Compute Context to specific Jobs?&lt;/STRONG&gt;&amp;nbsp; As opposed to specific users/groups?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Alternatively, is there any setting (analogous to the INIT setting of SAS 9 STPs) that will run whenever the compute session is launched?&amp;nbsp; As perhaps custom logic can be added there (&lt;A href="https://docs.datacontroller.io/dci-stpinstance/#stp-server-context" target="_self"&gt;in this fashion&lt;/A&gt;).&amp;nbsp; Note that the autoexec is not helpful here, as the runtime variables are injected after the autoexec executes.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2026 15:34:33 GMT</pubDate>
    <dc:creator>AllanBowe</dc:creator>
    <dc:date>2026-03-31T15:34:33Z</dc:date>
    <item>
      <title>Prevent Studio users from accessing custom Compute Context</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/985719#M3051</link>
      <description>&lt;P&gt;We have a web application that makes use of a custom Compute Context with a dedicated system account (SYSUSERID).&amp;nbsp; &amp;nbsp; Similar to a Stored Process context in SAS 9.&lt;BR /&gt;&lt;BR /&gt;The problem is that end users are able to select that context in other Viya applications, such as SAS Studio, and hence run their own code using that SYSUSERID.&lt;BR /&gt;&lt;BR /&gt;For a batch job, you would simply restrict which users can access the context.&amp;nbsp; But in this case, we need the end users to be able to access the context, albeit only for Jobs within a particular Viya Folder.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Is there any way to restrict access to a Compute Context to specific Jobs?&lt;/STRONG&gt;&amp;nbsp; As opposed to specific users/groups?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Alternatively, is there any setting (analogous to the INIT setting of SAS 9 STPs) that will run whenever the compute session is launched?&amp;nbsp; As perhaps custom logic can be added there (&lt;A href="https://docs.datacontroller.io/dci-stpinstance/#stp-server-context" target="_self"&gt;in this fashion&lt;/A&gt;).&amp;nbsp; Note that the autoexec is not helpful here, as the runtime variables are injected after the autoexec executes.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2026 15:34:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/985719#M3051</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2026-03-31T15:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent Studio users from accessing custom Compute Context</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/985861#M3052</link>
      <description>Access to a context would be driven by authorization rules against the CREATE (HTTP POST) permission on the URI /compute/contexts/&amp;lt;context-id&amp;gt;/sessions. Such a request would not include which job is being run for you to attach a condition to the access, but you could perhaps limit it based on the clientId being used to make the request. How is your web application running jobs?</description>
      <pubDate>Thu, 02 Apr 2026 15:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/985861#M3052</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2026-04-02T15:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent Studio users from accessing custom Compute Context</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/985935#M3053</link>
      <description>&lt;P&gt;Hi Greg - thanks for the followup.&lt;BR /&gt;&lt;BR /&gt;The web content is being served from the Files service, and as such it just passes the web token automatically in the SAS api requests and we have not needed to create a CLIENT_ID, nor invoke SASLogon.&amp;nbsp; &amp;nbsp;The url is in the pattern &lt;A href="https://SASSERVER/SASJobExecution?_file=/path/to/file.html" target="_blank" rel="noopener"&gt;https://SASSERVER/SASJobExecution?_file=/path/to/file.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If we were to use a client id (with auth / refresh token) we would still have the same problem though, as users could presumably still grab that token from their browser and spawn remote sessions under the remote credentials.&lt;BR /&gt;&lt;BR /&gt;In the SAS 9 world it was very much possible (and very common) for an administrator or developer to carefully define a Stored Process, running under a system account, and allow end users to run that Stored Process _without_ giving them the ability to run their own code in that same context.&lt;BR /&gt;&lt;BR /&gt;I guess my real question is, how to recreate that functionality with Viya (let end users safely run predefined jobs under system credentials) in the context of a single page web app (no external server, no browser leakage of secrets).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2026 18:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/985935#M3053</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2026-04-03T18:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Prevent Studio users from accessing custom Compute Context</title>
      <link>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/986574#M3058</link>
      <description>&lt;P&gt;To the point about "preventing studio users from accessing the context", Greg's post answers the question&lt;BR /&gt;&lt;BR /&gt;Regarding the part about triggering jobs under a system account without letting user inject code into that context, have raised a SAS Track with ServiceNow:&amp;nbsp; &amp;nbsp;CS0398400&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2026 21:13:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Viya/Prevent-Studio-users-from-accessing-custom-Compute-Context/m-p/986574#M3058</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2026-04-20T21:13:57Z</dc:date>
    </item>
  </channel>
</rss>

