0
votes

I created a user in sitecore with 2 roles assigned to him i.e author and publisher When this user who is both author and publisher creates any content he shouldn't be able to publish it.

Can i overwrite the publish action? check on the user who submitted the content and the roles he is assigned to and restrict him with a popup message or something like that? Any help is appreciated.

Thanks.

1
To clarify, authors with publishing permissions should not be able to publish their own content. Is this correct?Martin Davies
@MartinDavies yes, exactlyNewbie

1 Answers

0
votes

Follow the below steps to write custom publish actions

  1. For customizing the publish action, Write a c# class and inherit Sitecore.Shell.Applications.Dialogs.Publish.PublishForm.There are override methods like ActivePageChanged and OnNext. You can basically overwrite those classes and write your own alerts with Sitecore.Web.UI.Sheer.SheerResponse like shown below.
    SheerResponse.Alert("The current item will not be published.Please select both staging and web database to publish the HOME item.");
  2. Copy the Publish.xml file from (your siteroot/)/sitecore\shell\Applications\Dialogs\Publish.
  3. Create "sitecore\shell\Override\Applications\Dialogs\publish" in root of website
  4. Paste publish.xml in the following folder in root of your site "sitecore\shell\Override\Applications\Dialogs\publish"
  5. Open publish.xml file and modify the Wizard tag

    CodeBeside="Sitecore.Shell.Applications.Dialogs.Publish.PublishForm,Sitecore.Cli ent"

    to

    CodeBeside="your Class Name with name space here,your Assembly name"

Here is screenshot of how publishoverride form should look like

enter image description here