I've been trying to have specific tools on my website, only visibile if you are logged in as the admin account in the backoffice. I've had this working on previous versions of Umbraco 7, but can't for the life of me figure out how it works in Umbraco 8.
For context, it's used as a plugin installed in /App_Plugins/. Then fetched into the pages using:
I've tried Googling for the past few hours, and tried everything I've come across. All solutions suggesting using GetUmbracoAuthTicket() hasn't worked at all for me.
Let me know if you need anything else, hope some sharp minds in here are able to help! Thanks in advance!
Ensure that you are actually logged into the backoffice while you're testing this, I know it's stupid of me to point out the obvious but it's something I actually did forget to do.
Show content for backend admin only
Hey!
I've been trying to have specific tools on my website, only visibile if you are logged in as the admin account in the backoffice. I've had this working on previous versions of Umbraco 7, but can't for the life of me figure out how it works in Umbraco 8.
For context, it's used as a plugin installed in /App_Plugins/. Then fetched into the pages using:
So far I've tried the following, without much success:
I've also tried the following, with no luck:
Aswell as trying to get information about the logged in user using:
However this always returns false.
I've tried Googling for the past few hours, and tried everything I've come across. All solutions suggesting using GetUmbracoAuthTicket() hasn't worked at all for me.
Let me know if you need anything else, hope some sharp minds in here are able to help! Thanks in advance!
Did you figure this out? I have the same problem. :(
I have done some testing and the following is working in my Umbraco 8.1.0 project
Ensure that you are actually logged into the backoffice while you're testing this, I know it's stupid of me to point out the obvious but it's something I actually did forget to do.
This works! Thanks man!
Late here but how do I do this in Umbraco 10 where HttpContextWrapper and HttpContext.Current do not exist?
Thanks in advance!
I ended up using the Content Type service (IContentTypeService).
is working on a reply...