public virtual void RoleAlteredOrCreated(string roleName)
        {
            var role = new SitecoreRoleData(Role.FromName(roleName));

            if (_predicate == null || !_predicate.Includes(role).IsIncluded)
            {
                return;
            }

            _dataStore.Save(role);
        }
Beispiel #2
0
        public virtual void Load(IConfiguration configuration)
        {
            using (new UnicornOperationContext())
            {
                var roles = _roleDataStore
                            .GetAll()
                            .Where(role => _rolePredicate.Includes(role).IsIncluded)
                            .ToArray();

                foreach (var role in roles)
                {
                    DeserializeRole(role);
                }

                if (_syncConfiguration.RemoveOrphans)
                {
                    EvaluateOrphans(roles);
                }
            }
        }