Medium Trust: Relaxing assembly level security level and enforcing at method level.

--HG--
branch : dev
This commit is contained in:
Andre Rodrigues
2010-11-11 15:49:43 -08:00
parent cf2432acb5
commit ddec387c3a
3 changed files with 6 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Security;
using System.Web.Compilation;
namespace Orchard.Environment.Extensions.Compilers {
@@ -18,6 +19,7 @@ namespace Orchard.Environment.Extensions.Compilers {
_buildManager = buildManager;
}
[SecuritySafeCritical]
public CompilerResults CompileProject(string location) {
var codeProvider = CodeDomProvider.CreateProvider("cs");

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security;
using Orchard.FileSystems.VirtualPath;
namespace Orchard.Environment.Extensions.Compilers {
@@ -22,6 +23,7 @@ namespace Orchard.Environment.Extensions.Compilers {
/// Compile a csproj file given its virtual path. Use the CSharp CodeDomProvider
/// class, which is only available in full trust.
/// </summary>
[SecuritySafeCritical]
public CompilerResults CompileProject(string virtualPath, string outputDirectory) {
var codeProvider = CodeDomProvider.CreateProvider("cs");
var directory = _virtualPathProvider.GetDirectoryName(virtualPath);

View File

@@ -37,4 +37,5 @@ using System.Security;
[assembly: AssemblyVersion("0.8.0")]
[assembly: AssemblyFileVersion("0.8.0")]
[assembly: SecurityTransparent]
[assembly: AllowPartiallyTrustedCallers]
[assembly: SecurityRules(SecurityRuleSet.Level2)]