diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2005-03-02 16:51:18 +0300 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2005-03-02 16:51:18 +0300 |
commit | ff33076cef40821f5f00d9835242e9b1acfe6e43 (patch) | |
tree | 1d9e8cb7f2132410ce2ef242d0ce618fac05535b /mcs/class/corlib/System.Security/PermissionSet.cs | |
parent | 33e75c0000a33cc55f70104ddc65308f78530a13 (diff) |
2005-03-02 Sebastien Pouliot <sebastien@ximian.com>
* CodeAccessPermission.cs,
* PermissionSet.cs: Don't throw NotSupportedException if the security
manager (SecurityManager.SecurityEnabled) is off.
svn path=/trunk/mcs/; revision=41358
Diffstat (limited to 'mcs/class/corlib/System.Security/PermissionSet.cs')
-rw-r--r-- | mcs/class/corlib/System.Security/PermissionSet.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mcs/class/corlib/System.Security/PermissionSet.cs b/mcs/class/corlib/System.Security/PermissionSet.cs index 59cdee1525f..afae930622e 100644 --- a/mcs/class/corlib/System.Security/PermissionSet.cs +++ b/mcs/class/corlib/System.Security/PermissionSet.cs @@ -157,7 +157,7 @@ namespace System.Security { } // note: we must ignore the stack modifiers for the non-CAS permissions - if (count > 0) + if (SecurityManager.SecurityEnabled && (count > 0)) throw new NotSupportedException ("Currently only declarative Assert are supported."); } @@ -246,6 +246,9 @@ namespace System.Security { [MonoTODO ("Imperative mode isn't supported")] public virtual void Deny () { + if (!SecurityManager.SecurityEnabled) + return; + foreach (IPermission p in list) { // note: we ignore non-CAS permissions if (p is IStackWalk) { @@ -335,6 +338,9 @@ namespace System.Security { [MonoTODO ("Imperative mode isn't supported")] public virtual void PermitOnly () { + if (!SecurityManager.SecurityEnabled) + return; + foreach (IPermission p in list) { // note: we ignore non-CAS permissions if (p is IStackWalk) { |