Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hermanussen/510223292b2971a659b8d26f7c7bd4f5 to your computer and use it in GitHub Desktop.
Save hermanussen/510223292b2971a659b8d26f7c7bd4f5 to your computer and use it in GitHub Desktop.
// Optional: uncomment whichever ways you feel are appropriate for security
// Ensure that your monitoring tool matches these
if (!(true
//&& Request.IsSecureConnection // Checks if using HTTPS
//&& Request.QueryString["authkey"] == @"secret"
&& Request.UserHostAddress == "127.0.0.1"
//&& Sitecore.Context.IsLoggedIn
//&& Sitecore.Context.IsAdministrator
//&& Sitecore.Context.User.IsInRole(@"sitecore\Developer")
))
{
Response.StatusCode = (int)System.Net.HttpStatusCode.Forbidden;
Response.Write("You are not authorized to view this page");
Response.TrySkipIisCustomErrors = true;
Response.End();
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment