Looking for sitecore Answers? Try Ask4KnowledgeBase
Looking for sitecore Keywords? Try Ask4Keywords

sitecoreSecurity


Remarks

Sitecore offers two ways to access items that the context user doesn't have permissions to access. The preferred way is to use the UserSwitcher class to temporarily change the user that will be used to access the item. The reason that this is preferred is because you can still have permissions in effect for the user account that is being utilised.

The alternative is to use the SecurityDisabler class. This performs the action without any security constraints.

It is recommended to only use these classes for the operations that require elevated permissions. The best way to ensure this is by utilising the 'using' keyword in C#; this will ensure that the UserSwitcher / SecurityDisabler is correctly disposed.