Defining Scrivito users' scope of action
Scrivito keeps its own record of individual CMS users and their working copies. Whenever a particular permission is required to perform an action such as publishing a working copy, you can have one or more callbacks executed to determine whether to allow or deny the action. This makes it possible to freely define rules that optionally take account of permissions, properties, or criteria defined elsewhere, e.g. in your user management back end.
Scrivito users originate from the users maintained by your back end. In order to impose CMS permission logic on the original users, we need to additionally represent them as Scrivito users. In this process, we can check the criteria to be met for being a supereditor.
So, what we need is a method that translates a back end user to a Scrivito user. We'll call it
from and put it into a module,
ScrivitoUser. Later on, we'll use the method to determine the current user and equip them with sweeping powers if they deserve it.