mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Shouldn't MiniProfiler.RenderIncludes() use MiniProfiler.Settings.Results_Authorize to determine if the includes be rendered for the current request? #132

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I had to add the following code to the top of the RenderIncludes method so the 
javascript wouldn't keep attempting to fetch the results page via JS.

//Make sure current user/request is allowed to see results.
var context = HttpContext.Current;
var authorize = MiniProfiler.Settings.Results_Authorize;
if (authorize != null && context != null && !authorize(context.Request, 
profiler)) {
return new HtmlString("");
}

I might be using it wrong though, but I followed the Sample.Mvc app as closely 
as I could.

Original issue reported on code.google.com by g...@null.co.nz on 31 Jan 2012 at 3:36

GoogleCodeExporter commented 8 years ago
yeah I agree this is confusing, cleaning it up

Original comment by sam.saff...@gmail.com on 8 Feb 2012 at 2:56

GoogleCodeExporter commented 8 years ago
OK, it respects the setting now and runs mini profiler in a "hidden" mode if 
the user has no permission to see the results 

Original comment by sam.saff...@gmail.com on 13 Feb 2012 at 5:25

GoogleCodeExporter commented 8 years ago

Original comment by sam.saff...@gmail.com on 13 Feb 2012 at 5:26