sitecore - Disable designing role programmatically -


I was thinking that there was any way to turn on / disable the designer role from code. Desired effect from command: WebEdit: Toggleness capabilities .

Image of the command in the Page Editor:

I How do I toggle designing capabilities with code?

Toggles the status given below to the current user's status. It should work for you or at least tell you in the right direction. I did not have the time to test it, so you have to do it on your own. Remember to refresh the page after executing the code:

  string key = "/ current_uppress / page editor / ability / design"; If (Sitecore.Web.UI.HtmlControls.Registry.GetString (key, "on") == "ON") {Sitecore.Web.UI.HtmlControls.Registry.SetString (key, "off"); } And (if (WebEditUtil.CanDesignItem (Sitecore.Context.Item)) {Sitecore.Web.UI.HtmlControls.Registry.SetString (key, "on");}}  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -