In Kentico 8.2 I have set up staging to push all my changes from dev through UAT to live.
Each of these environments has its own set of users. I assume this is a very common scenario - it doesn't make sense to have production user accounts in dev. Simple example, in dev I want my global admin account to have an empty password but obviously not in UAT and live.
Therefore I've excluded all changes to users from staging using the following implmentation of `CMSLoaderAttribute`:
public override void Init()
{
StagingEvents.LogTask.Before += LogTask_Before;
}
void LogTask_Before(object sender, CMS.Synchronization.StagingLogTaskEventArgs e)
{
// Gets the synchronized object
BaseInfo synchronizedObject = e.Object;
// Cancels the creation of content staging tasks for the deletion of role objects
if (synchronizedObject.TypeInfo.ObjectType == CMS.Membership.UserInfo.OBJECT_TYPE)
{
e.Cancel();
}
}
However, I do want to be able to configure roles in my dev environment and push these roles through the staging process.
The problem is that after synchronising environments I'm finding that the roles in the target instance have had their users removed. Presumably this is because the synchronisation task doesn't know about these users.
So Kentico is not fully separating roles (which for me are part of the application architecture) from users (which are environment-specific). Is there anything I can do about this? I guess what I want to do is synchronise everything about a role except for its user associations. Is this, or something similar, possible?
↧