That you can filter our from the python source code or replace such call with exception (&quot;bzz, can&#39;t load AddReference&quot;) - Yeah, it&#39;s a pretty nasty workaround, but it works.<br><br>Dody G.<br><br><div class="gmail_quote">
On Mon, Jun 30, 2008 at 3:26 PM, Michael Foord &lt;<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Dody Gunawinata wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In the IronPython hosting API, unless you specifically load the assembly, it will not be accessible through the script. So right now restricting access means configuring the assemblies you want to expose to the script.<br>

<br>
</blockquote>
<br></div>
But what is to stop the user code doing:<br>
<br>
import clr<br>
clr.AddReference(&#39;SomeAssembly&#39;)<br>
<br>
Loading the ScriptRuntime into an AppDomain and restricting the privileges on that is one way - but I don&#39;t think that IronPython will work at all unless the AppDomain has pretty much full trust.<br>
<br>
Michael Foord<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
On Mon, Jun 30, 2008 at 3:09 PM, Ben Hall &lt;<a href="mailto:ben2004uk@googlemail.com" target="_blank">ben2004uk@googlemail.com</a> &lt;mailto:<a href="mailto:ben2004uk@googlemail.com" target="_blank">ben2004uk@googlemail.com</a>&gt;&gt; wrote:<br>

<br>
 &nbsp; &nbsp;I thought this last night, it would be really useful if we could<br>
 &nbsp; &nbsp;&#39;sandbox&#39; the IP engine and limit it&#39;s access to certain areas of the<br>
 &nbsp; &nbsp;framework.<br>
<br>
<br>
<br>
 &nbsp; &nbsp;On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis<br></div><div><div></div><div class="Wj3C7c">
 &nbsp; &nbsp;&lt;<a href="mailto:r.worbis@cubido.at" target="_blank">r.worbis@cubido.at</a> &lt;mailto:<a href="mailto:r.worbis@cubido.at" target="_blank">r.worbis@cubido.at</a>&gt;&gt; wrote:<br>
 &nbsp; &nbsp;&gt; No - for example i would like to prevent that the user loads<br>
 &nbsp; &nbsp;assemblies and does own data access via System.Data.SqlClient.<br>
 &nbsp; &nbsp;&gt; Or uses specific parts of the applications. (which should be<br>
 &nbsp; &nbsp;visible to other scripts). So access control per script would be<br>
 &nbsp; &nbsp;optimal.<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt; Rainer<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt; -----Ursprüngliche Nachricht-----<br>
 &nbsp; &nbsp;&gt; Von: <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a><br>
 &nbsp; &nbsp;&lt;mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>&gt;<br>
 &nbsp; &nbsp;[mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a><br>
 &nbsp; &nbsp;&lt;mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>&gt;] Im Auftrag von<br>
 &nbsp; &nbsp;Korbinian Abenthum<br>
 &nbsp; &nbsp;&gt; Gesendet: Montag, 30. Juni 2008 13:47<br>
 &nbsp; &nbsp;&gt; An: Discussion of IronPython<br>
 &nbsp; &nbsp;&gt; Betreff: Re: [IronPython] restrict scripting access<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt; Rainer Worbis wrote:<br>
 &nbsp; &nbsp;&gt;&gt; is there a way to restrict access to objects or namespaces<br>
 &nbsp; &nbsp;&gt;&gt; within a script? We use IronPython for providing scripting<br>
 &nbsp; &nbsp;&gt;&gt; functionality within our .NET Application but would like to<br>
 &nbsp; &nbsp;&gt;&gt; restrict access to certain functions. Has anybody information<br>
 &nbsp; &nbsp;&gt;&gt; or a sample how to do that?<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt; Can you declare the restricted objects as &quot;internal&quot;?<br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;&gt; Cheers,<br>
 &nbsp; &nbsp;&gt; &nbsp;Korbinian<br>
 &nbsp; &nbsp;&gt; _______________________________________________<br>
 &nbsp; &nbsp;&gt; Users mailing list<br></div></div>
 &nbsp; &nbsp;&gt; <a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a> &lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;<div class="Ih2E3d">
<br>
 &nbsp; &nbsp;&gt; <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
 &nbsp; &nbsp;&gt; _______________________________________________<br>
 &nbsp; &nbsp;&gt; Users mailing list<br></div>
 &nbsp; &nbsp;&gt; <a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a> &lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;<div class="Ih2E3d">
<br>
 &nbsp; &nbsp;&gt; <a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
 &nbsp; &nbsp;&gt;<br>
 &nbsp; &nbsp;_______________________________________________<br>
 &nbsp; &nbsp;Users mailing list<br></div>
 &nbsp; &nbsp;<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a> &lt;mailto:<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a>&gt;<div class="Ih2E3d">
<br>
 &nbsp; &nbsp;<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br>
<br>
<br>
<br>
-- <br>
</div><a href="http://nomadlife.org" target="_blank">nomadlife.org</a> &lt;<a href="http://nomadlife.org" target="_blank">http://nomadlife.org</a>&gt;<br>
------------------------------------------------------------------------<div class="Ih2E3d"><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
 &nbsp;<br>
</div></blockquote><font color="#888888">
<br>
<br>
-- <br>
<a href="http://www.ironpythoninaction.com/" target="_blank">http://www.ironpythoninaction.com/</a><br>
<a href="http://www.voidspace.org.uk/" target="_blank">http://www.voidspace.org.uk/</a><br>
<a href="http://www.trypython.org/" target="_blank">http://www.trypython.org/</a><br>
<a href="http://www.ironpython.info/" target="_blank">http://www.ironpython.info/</a><br>
<a href="http://www.resolverhacks.net/" target="_blank">http://www.resolverhacks.net/</a><br>
<a href="http://www.theotherdelia.co.uk/" target="_blank">http://www.theotherdelia.co.uk/</a><br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br><a href="http://nomadlife.org">nomadlife.org</a><br>