0

I have a requirement like a user should create and approve their OWN content only and it should not accessible that created/updated Sitecore items to other users.

Ex: user1 has created a test1 page and can access and approve his OWN content. And this test1 item shouldn't allow approving for other users.

3
  • 2
    What's the point of an approval process where one self approves?
    – Mark Cassidy
    Commented Jun 18, 2019 at 9:26
  • I can understood your question, but at least can we restrict the items that user1 (editor role) created should not show to user2 (editor role) in workbox?
    – Ramesh Ch
    Commented Jun 18, 2019 at 9:39
  • To clarify, is your need to restrict to a user or role? Self-approval only is not OOTB but you can definitely have different roles that approve different content areas. Commented Jun 20, 2019 at 12:00

1 Answer 1

1

There is no Sitecore out-of-box feature to achieve your requirement. You have to customize Sitecore module(s) but personally I don't recommend that.

Rather you can implement something like below, In each workflow state set the next state as empty and create an action, in action class code check whether the current user is the owner/last updated the item if yes then move the item to next state; if not display an error/alert.

enter image description here

enter image description here

namespace Test
{

    public class CheckUser
    {

        public void Process(WorkflowPipelineArgs workflowActionArgument)
        {
            if(Sitecore.Context.User.Name.Equals("item owner"))
            {
                // Update the State to next state
            }
            else
            {
                // show an alert box
            }
        }
    }
}

If you don't like the above option and wanted to update the Workbox then, go to folder ..\website\sitecore\shell\Applications\Workbox, Initially Default.aspx page loads when you click the Workbox, where it handles the logic to display the items to be displayed in Workbox when you check/uncheck any Workflow. You have to overwrite/implement a similar class like Sitecore.Shell.Applications.Workbox.WorkboxForm and write your own logic to display the items from any specific workflow state. [in your case may be you can check the Created By/Updated By with the current user and ensure the item shown for that specific user].

Note - If you extent/customize workbox code then you also need to think about the review tab where user can execute the workflow steps. So same customization needs to be done here, so better avoid customizing the Workbox or Sitecore security. Rather Customize the Workflow based on your need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.