I have seen the following two accessible booleans:
System.Web.Mvc.Controller.User.Identity.IsAuthenticated
System.Web.Mvc.Controller.Request.IsAuthenticated
Is there a difference between these. They both seem to do the same thing so I am not sure which to use.
What I would like to do is:
@if (User.Identity.IsAuthenticated) {
if (User.IsInRole("Admin")) {
@Html.ActionLink("Admin", "AdminController")
}
}
or
@if (Request.IsAuthenticated) {
if (User.IsInRole("Admin")) {
@Html.ActionLink("Admin", "AdminController")
}
}
Would either of the above work equally well ?