/// <summary> /// Ensures VisitorGroupContentProviderModels are removed from the datastore, if the underlying VisitorGroup has been removed /// </summary> internal void RemoveModelsWithUnknownVisitorGroup() { var groupStore = new VisitorGroupStore(); IEnumerable <VisitorGroupContentProviderModel> allSavedModels = ContentProviderService.GetAllModels(); foreach (var contentProviderModel in allSavedModels) { VisitorGroup group = groupStore.Load(contentProviderModel.VisitorGroupId); if (group == null) { ContentProviderService.Delete(contentProviderModel.Id.ExternalId); } } }
private bool VisitorIsInGroup(IPrincipal principal, IContentProvider contentProvider) { VisitorGroup group = new VisitorGroupStore().Load(contentProvider.VisitorGroupId); return(new VisitorGroupHelper().IsPrincipalInGroup(principal, group.Name)); }
public VisitorGroupContentProviderModel() { GroupStore = new VisitorGroupStore(); }