Because the admin filter is calling lcoalization, and localization is calling the admin filter... we should apply the admin attribute first, then do the security check

This commit is contained in:
Nicholas Mayne
2015-03-13 17:06:48 +00:00
parent 8470165a55
commit 383e947bf7

View File

@@ -20,11 +20,11 @@ namespace Orchard.UI.Admin {
public void OnAuthorization(AuthorizationContext filterContext) {
if (IsAdmin(filterContext)) {
Apply(filterContext.RequestContext);
if (!_authorizer.Authorize(StandardPermissions.AccessAdminPanel, T("Can't access the admin"))) {
filterContext.Result = new HttpUnauthorizedResult();
}
Apply(filterContext.RequestContext);
}
}