Sometimes, content authors need to perform some necessary operations for which they do not have access rights. Giving additional rights to them is not a permanent solution as requirements can vary from user to user or case to case. Sitecore gives freedom to developers by providing a security context switching feature so that users can perform some secured item or field-level changes in the security context of other users.
Let's consider a case where some super content author needs a facility to unlock pages locked by other content authors. So, instead of giving them rights to unlock the pages, we can do this impersonating the user and disabling security.
Create two different buttons in the Content Editor from the core
database and define two respective command names for them. One button will be performing the item unlock using User Impersonation and another will be performing the item unlock using Security Disabler.