mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Medium Trust: Relaxing assembly level security level and enforcing at method level.
--HG-- branch : dev
This commit is contained in:
@@ -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");
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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)]
|
Reference in New Issue
Block a user