Profil de JohnJohn West Blogs about Si...PhotosBlogListes Outils Aide

Blog


06/07/2009

Prevent Sitecore Reviewers from Approving their Own Changes

In some organizations, Sitecore CMS users function as both editors and reviewers in a single workflow, but should not be able to review and approve their own changes. There is no “out-of-the-box” Sitecore feature that meets this requirement, but it’s relatively easy to add one.

Add a class such as the following to the Visual Studio project:

namespace Sitecore.Sharedsource.Workflow.Actions
{
  using System;

  public class ValidateApprover
  {
    public void Process(Sitecore.Workflows.Simple.WorkflowPipelineArgs args)
    {
      if (String.Compare(
        args.DataItem.Statistics.UpdatedBy,
        Sitecore.Context.User.Name,
        true) != 0)
      {
        return;
      }

      Sitecore.Web.UI.Sheer.SheerResponse.Alert(
        "You cannot approve your own changes.");
      args.AbortPipeline();
    }
  }
}

In the Content Editor, under the Approve command under the Review state of the workflow, insert an item named ValidateApprover using the System/Workflow/Action data template. In the Data section, in the Type string field, enter the type signature:

Sitecore.Sharedsource.Workflow.Actions.ValidateApprover, Assembly

I added this class to the Sitecore Shared Source Library project and updated the corresponding documentation.

Commentaires

Veuillez patienter...
Le commentaire entré est trop long. Raccourcissez-le.
Vous n'avez rien entré. Réessayez.
Il est actuellement impossible d'ajouter votre commentaire. Réessayez plus tard.
Pour ajouter un commentaire, tu dois avoir l'autorisation de tes parents. Demander l'autorisation
Tes parents ont désactivé les commentaires.
Il est actuellement impossible de supprimer votre commentaire. Réessayez plus tard.
Vous avez dépassé le nombre maximal de commentaires qu'il est possible d'envoyer le même jour. Réessayez dans 24 heures.
Votre compte a pu laisser les commentaires désactivés parce que nos systèmes indiquent que vous risquez d'arroser d'autres utilisateurs de messages. Si vous pensez que votre compte a été désactivé par erreur, contactez l'assistance en ligne de Windows Live.
Effectuez la vérification de sécurité ci-dessous pour finaliser l'envoi de votre commentaire.
Les caractères entrés pour la vérification de sécurité doivent correspondre à ceux de l'image ou du fichier audio.

Pour ajouter un commentaire, connectez-vous avec votre identifiant Windows Live ID (si vous utilisez Messenger ou Xbox LIVE, vous avez un identifiant Windows Live ID). Connectez-vous


Vous n'avez pas d'identifiant Windows Live ID ? Inscrivez-vous

Rétroliens

L'URL de rétrolien de ce billet est :
http://sitecorejohn.spaces.live.com/blog/cns!960125F1D4A59952!413.trak
Blogs Web qui font référence à ce billet
  • Aucune