1

I have a requirement from one of our clients related to Sitecore security roles.

The requirement is that an item can be visible only to the owner of that item and only they have the access to edit the item. I've searched for this specific requirement on the internet and I couldn't find any relevant articles or suggestions related to the above requirement. Also, I couldn't see that there is no way for giving permission to the owner access.

Is there any better way to approach this requirement either using a security role or custom code? Thanks in advance.

3
  • What about "item:saved" event handler which would check if item owner is not empty and assign correct access rights (clear existing rights, break inheritance for everyone, add read, write and whatever is needed for the owner)?
    – Marek Musielak
    Commented Nov 2, 2020 at 10:01
  • Yeah, @MarekMusielak I was working on the same in item save the event and looking for implementing the same logic (checking current user and item owner is same) in item lock and edit, but I want to know is there any better logic than this. Any idea? Commented Nov 2, 2020 at 10:14
  • Since you earlier mentioned, only item owners should be able to view/edit the item, what I suggest is, to have your own implementation of "" and in that you can check Commented Nov 2, 2020 at 11:04

1 Answer 1

3

Since you earlier mentioned, that only item owners should be able to view/edit the item, what I suggest is, to have your own implementation of the ItemResolver pipeline processor and in that, you can check the current user's role is creator\owner (check this) or you can also check if Item.Security.GetOwner() is the context user, and only then continue with the same context item or else you can set the context item to your 404 or some other custom page item or home page item or even display an error message. Make sure to add your custom pipeline processor after the default Sitecore one.

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.