_PageStart.cshtml in the .\Admin Folder

 

@{

    Response.CacheControl = "no-cache";

    // Determine whether current user is in Admin role

    if (!Roles.IsUserInRole(WebSecurity.CurrentUserName, "Admin")){

      Response.SetStatus(HttpStatusCode.Forbidden);

    }

} 

 


Return to sample app.

Return to blog entry