Skip to content

Instantly share code, notes, and snippets.

@nikmd23
Created November 25, 2015 00:17
Show Gist options
  • Save nikmd23/88a772bef947e05692d9 to your computer and use it in GitHub Desktop.
Save nikmd23/88a772bef947e05692d9 to your computer and use it in GitHub Desktop.
// This Gist was created to answer @rionmonster's tweet at http://www.twitter.com/rionmonster/status/669288962444419072
// This accurately reflects the state of Glimpse 2.0.0-Beta1, however we are already looking to improve this and these
// will most likey change.
// Feedback and use cases are welcome and wanted!
// This is a portion of Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.AddGlimpse().RunningServerWeb(options =>
{
// This basically controls access to resource the client needs. Think of these as the "client"
// or "read-only" resources
options.AllowClientAccess = httpContext => httpContext.User.IsInRole("Admin");
// This controls access to resources the agents need. Think of these basically as "agent"
// or "write-only" resources
options.AllowAgentAccess = HttpContext => true;
});
// Other service configuration...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment