We have moved to GitHub Issues
You are viewing the read-only archive of Umbraco's issue tracker. To create new issues, please head over to GitHub Issues.
Make sure to read the blog posts announcing the move for more information.
Created by Mike Chambers 12 Mar 2013, 12:44:49 Updated by esunxray 26 Sep 2013, 07:28:02
Subtask of: U4-2288
Just wondering what the recommended approach is now..
Searching the current source... umbracoUseMediumTrust doesn't seem to be used in any source file.. apart from the osolete umbraco.buisnesslogic/globalsettings.cs
There is a Umbraco.Core.Configuration/Globalsettings.cs but that has private members and no longer has the UseMediumTrust anyway??
Is everything supposed to be mediumtrust safe so there is no need for this flag and the setting in the web.config has no use?
Indeed. :-) Will remove in v7 so we don't break backwards compatibility in a minor/patch release.
hmmm./.. would that break a lot of packages that might be using the flag to code full vs medium trust?
ones that I have especially come across are the use of the System.Web.Configuration.WebConfigurationManager, which requires full trust and having to revert to xml manipulation for medium trust.. but if full trust is available then the webConfiguartionManager is the better implementation?
ps the about umbraco button in the admin still fails in medium trust... trying to read the version from the dll :-) not a good advert for mediumtrust safe ;-)
Mike: Maybe, I don't think anybody is using it particularly as they should be reading the
Ah, really? I never click that one.. ;-) Make sure to create another issue for the About button please. :)
reading the trust key, from the web.config?
if you mean the trust key in the web.config then that could be problematic... for rackspace cloud for instance there is no trust key as they set at the application config level... and including a trust node causes an error as they expressively forbid it.
Ah, well, I was wrong on that one :-)
Here's how to do it properly:
http://stackoverflow.com/questions/1064274/get-current-asp-net-trust-level-programmatically
not disimilar to the old method in obsolete globalSettings.cs :-) just lifted that into my own class library.
public static bool UseMediumTrust { get { try { var trustLevel = SystemUtilities.GetCurrentTrustLevel(); if (trustLevel == AspNetHostingPermissionLevel.High || trustLevel == AspNetHostingPermissionLevel.Unrestricted) return false; else return bool.Parse(ConfigurationManager.AppSettings["umbracoUseMediumTrust"]); } catch { return false; } } }
we have this in the core:
Umbraco.Core.SystemUtilities.GetCurrentTrustLevel()
to get the current trust level which works in med trust.
V7 is a very nice chance to clean up the code.
Priority: Normal
Type: Bug
State: Fixed
Assignee:
Difficulty: Normal
Category:
Backwards Compatible: False
Fix Submitted:
Affected versions: 4.11.5, 4.11.6
Due in version: 7.0.0
Sprint:
Story Points:
Cycle: