I have already raised this question with Kentico devnet and Kentico support and haven't yet received a solution. I'm hoping the wider SO community will come up with something.
For reference, here is the devnet thread: http://devnet.kentico.com/questions/content-staging-how-can-i-stage-role-changes-but-ignore-user-changes
To summarise, I'm building a large multi-site web platform using Kentico. The staging module is configured to deploy Kentico object changes through a linear chain of environments from dev to UAT and on to production. Each of these environments naturally has a different set of users. Therefore I've excluded users and user-role relationships from the staging process as follows:
public class KingspanUserEvents : CMSLoaderAttribute
{
public override void Init()
{
UserInfo.TYPEINFO.LogSynchronization = CMS.DataEngine.SynchronizationTypeEnum.None;
UserRoleInfo.TYPEINFO.LogSynchronization = CMS.DataEngine.SynchronizationTypeEnum.None;
}
}
However, I'm finding that when changed roles are logged as staging tasks, part of the serialised role data is its user associations. Remember these users will be users which only exist in the source environment.
This has the effect that when the environments are synced, the role is updated at the target and all users are removed from the role.
Kentico support say "We are already aware of this and it is on the list of future improvements.". However, to me it's a fundamental flaw in a CMS which has enterprise aspirations. A failure to maintain a separation between the application architecture (roles) and live data (users) means that I cannot create reliable deployments for a core part of my application.
So my question is, has anyone found a work-around for this issue? I wonder if it might be possible to hook into the StagingEvents.ProcessTask.Before
event handler to somehow prevent users being removed.