A custom dashboard / section probably makes most sense here.
But I suppose you could in theory use Umbraco's UserService, to pull back the current logged in back office user: something a little bit like this:
var userService = ApplicationContext.Current.Services.UserService;
var currentUser = userService.GetByUsername(HttpContext.Current.User.Identity.Name);
if (currentUser != null && currentUser.UserType.Alias == "Administrator"){
// do your admin stuff here
}
else {
// don't show the page
}
Best way to restrict access to a page on the website to an umbraco admin user
We have a page on our site that we only want the umbraco admin user to have access to.
Could anyone recommend the best way to achieve this? Or would I need to create a custom section and add the page there.
Thanks.
Hi HP21
A custom dashboard / section probably makes most sense here.
But I suppose you could in theory use Umbraco's UserService, to pull back the current logged in back office user: something a little bit like this:
Thank you Marc for your help.
is working on a reply...