public RegisterController(UIUserProvider userProvider, UIRoleProvider roleProvider, UISignInManager signInManager, IContentSecurityRepository contentSecurityRepository) { _userProvider = userProvider; _roleProvider = roleProvider; _signInManager = signInManager; _contentSecurityRepository = contentSecurityRepository; }
public AdminRegistrationController() { _UIUserProvider = ServiceLocator.Current.GetInstance <UIUserProvider>();; _UIRoleProvider = ServiceLocator.Current.GetInstance <UIRoleProvider>(); _UISignInManager = ServiceLocator.Current.GetInstance <UISignInManager>(); _contentSecurityRepository = ServiceLocator.Current.GetInstance <IContentSecurityRepository>(); }
public void Initialize(InitializationEngine context) { _contentRootService = ServiceLocator.Current.GetInstance <ContentRootService>(); _contentSecurityRepository = ServiceLocator.Current.GetInstance <IContentSecurityRepository>(); InitializeGoogleContactsComponent(context); }
public ContentApprovalsManagerPageController( IApprovalDefinitionRepository repoDefinitions, IContentRepository repoContent, IApprovalRepository repoApprovals, IApprovalEngine engine, UIRoleProvider roles, UIUserProvider users, IContentSecurityRepository repoSecurity) { this.repoDefinitions = repoDefinitions; this.repoContent = repoContent; this.repoApprovals = repoApprovals; this.engine = engine; // if the editors role does not exist, create it and assign access rights if (!roles.RoleExists(editors)) { roles.CreateRole(editors); var permissions = repoSecurity.Get(ContentReference.RootPage).CreateWritableClone() as IContentSecurityDescriptor; permissions.AddEntry(new AccessControlEntry(editors, AccessLevel.Create | AccessLevel.Edit | AccessLevel.Delete | AccessLevel.Read | AccessLevel.Publish)); repoSecurity.Save(ContentReference.RootPage, permissions, SecuritySaveType.Replace); } // create three users and add them to roles UIUserCreateStatus status; IEnumerable <string> errors = Enumerable.Empty <string>(); if (users.GetUser(userName1) == null) { users.CreateUser( userName1, password, email: userName1.ToLower() + emailBase, passwordQuestion: null, passwordAnswer: null, isApproved: true, status: out status, errors: out errors); roles.AddUserToRoles(userName1, new string[] { admins }); } if (users.GetUser(userName2) == null) { users.CreateUser( userName2, password, userName2.ToLower() + emailBase, null, null, true, out status, out errors); roles.AddUserToRoles(userName2, new string[] { editors }); } if (users.GetUser(userName3) == null) { users.CreateUser( userName3, password, userName3.ToLower() + emailBase, null, null, true, out status, out errors); roles.AddUserToRoles(userName3, new string[] { editors }); } }
public ResetAdminController(IContentSecurityRepository securityRepository, IPageCriteriaQueryService pageFinder, UIUserProvider users, UIRoleProvider roles) { this.securityRepository = securityRepository; this.users = users; this.roles = roles; }
public void Initialize(InitializationEngine context) { if (!initialized) { contentLoader = context.Locate.Advanced.GetInstance <IContentLoader>(); contentSecurityRepository = context.Locate.Advanced.GetInstance <IContentSecurityRepository>(); contentSecurityRepository.ContentSecuritySaving += ContentSecurityRepository_ContentSecuritySaving; initialized = true; } }
public UserManagementService(IAccountRepository accountRepository, IContentSecurityRepository contentSecurityRepository, IUserTermsOfUseRepository userTermsOfUseRepository, IOrganizationUserRepository orgUserRepo, ITokenGenerator tokenGenerator) { _accountRepository = accountRepository; _contentSecurityRepository = contentSecurityRepository; _userTermsOfUseRepository = userTermsOfUseRepository; _orgUserRepo = orgUserRepo; _tokenGenerator = tokenGenerator; }
private void AddUsersAndRoles(IContentSecurityRepository securityRepository) { var password = "******"; AddRole("WebAdmins", AccessLevel.FullAccess, securityRepository); AddRole("WebEditors", AccessLevel.FullAccess ^ AccessLevel.Administer, securityRepository); AddUser("cmsadmin", "Administrator Administrator", password, new[] { "WebEditors", "WebAdmins" }); AddUser("abbie", "Abbie Andrea", password, new[] { "WebEditors", "WebAdmins" }); AddUser("eddie", "Eddie Elridge", password, new[] { "WebEditors" }); AddUser("erin", "Erin Ehrhardt", password, new[] { "WebEditors" }); AddUser("reid", "Reid Rezac", password, new[] { "WebEditors" }); }
public void Initialize(InitializationEngine context) { IContentEvents events = context.Locate.Advanced.GetInstance <IContentEvents>(); events.PublishedContent += IndexingEvents.UpdateIndex; events.DeletingContent += IndexingEvents.DeleteFromIndex; events.MovedContent += IndexingEvents.UpdateIndex; events.SavedContent += IndexingEvents.UpdateIndex; IContentSecurityRepository contentSecurityRepository = context.Locate.Advanced.GetInstance <IContentSecurityRepository>(); contentSecurityRepository.ContentSecuritySaved += IndexingEvents.UpdateIndex; }
private void AddRole(string roleName, AccessLevel accessLevel, IContentSecurityRepository securityRepository) { if (!UIRoleProvider.RoleExists(roleName)) { UIRoleProvider.CreateRole(roleName); var permissions = (IContentSecurityDescriptor)securityRepository.Get(ContentReference.RootPage).CreateWritableClone(); permissions.AddEntry(new AccessControlEntry(roleName, accessLevel)); securityRepository.Save(ContentReference.RootPage, permissions, SecuritySaveType.Replace); securityRepository.Save(ContentReference.WasteBasket, permissions, SecuritySaveType.Replace); } }
private void AddUsersAndRoles(IContentSecurityRepository securityRepository) { var password = "******"; AddRole("WebAdmins", AccessLevel.FullAccess, securityRepository); AddRole("WebEditors", AccessLevel.FullAccess ^ AccessLevel.Administer, securityRepository); AddUser("cmsadmin", "Administrator Administrator", password, new[] { "WebEditors", "WebAdmins" }); AddUser("alfred", "Alfred Andersson", password, new[] { "WebEditors", "WebAdmins" }); AddUser("emil", "Emil Svensson", password, new[] { "WebEditors" }); AddUser("ida", "Ida Svensson", password, new[] { "WebEditors" }); AddUser("lina", "Lina Lindström", password, new[] { "WebEditors" }); }
public void Initialize(InitializationEngine context) { Indexing.Instance.ExcludeType <SynonymBackupFile>(); Indexing.Instance.ExcludeType <SynonymBackupFileFolder>(); IContentEvents events = ServiceLocator.Current.GetInstance <IContentEvents>(); events.PublishedContent += IndexingEvents.UpdateIndex; events.DeletingContent += IndexingEvents.DeleteFromIndex; events.MovedContent += IndexingEvents.UpdateIndex; IContentSecurityRepository contentSecurityRepository = context.Locate.Advanced.GetInstance <IContentSecurityRepository>(); contentSecurityRepository.ContentSecuritySaved += IndexingEvents.UpdateIndex; }
public void Uninitialize(InitializationEngine context) { if (!LuceneConfiguration.Active) { return; } IContentEvents contentEvents = context.Locate.ContentEvents(); IContentSecurityRepository securityRepository = context.Locate.ContentSecurityRepository(); contentEvents.PublishedContent -= new EventHandler <ContentEventArgs>(PublishContent); contentEvents.MovedContent -= new EventHandler <ContentEventArgs>(MovedContent); contentEvents.DeletedContent -= new EventHandler <DeleteContentEventArgs>(DeleteContent); contentEvents.DeletedContentLanguage -= new EventHandler <ContentEventArgs>(DeleteContentLanguage); securityRepository.ContentSecuritySaved -= new EventHandler <ContentSecurityEventArg>(UpdateSecurity); }
private void SetAccessControlListForContent(ContentReference reference, string role, AccessLevel level) { IContentSecurityRepository contentSecurityRepository = ServiceLocator.Current.GetInstance <IContentSecurityRepository>(); IContentSecurityDescriptor permissions = contentSecurityRepository.Get(reference).CreateWritableClone() as IContentSecurityDescriptor; //Not IContentSecurityDescriptor if (permissions == null) { return; } permissions.AddEntry(new AccessControlEntry(role, level)); contentSecurityRepository.Save(reference, permissions, SecuritySaveType.Replace); }
public void Initialize(InitializationEngine context) { _contentEvents = context.Locate.Advanced.GetInstance <IContentEvents>(); _contentSecurityRepository = context.Locate.Advanced.GetInstance <IContentSecurityRepository>(); _contentLoader = context.Locate.Advanced.GetInstance <IContentLoader>(); _contentCacheKeyCreator = context.Locate.Advanced.GetInstance <IContentCacheKeyCreator>(); _htmlCache = context.Locate.Advanced.GetInstance <IDistributedCache>(); _contentEvents.CreatedContent += ContentCreated; _contentEvents.MovedContent += MovedContent; _contentEvents.PublishingContent += PublishingContent; _contentEvents.PublishedContent += PublishedContent; _contentEvents.DeletedContent += DeletedContent; _contentSecurityRepository.ContentSecuritySaved += ContentSecuritySaved; }
public void Initialize(InitializationEngine context) { System.Web.Mvc.ViewEngines.Engines.Add(new XhtmlStringViewEngine(new XhtmlStringRenderer(context.Locate.Advanced.GetInstance <IRenderingContextResolver>()))); _htmlCache = context.Locate.Advanced.GetInstance <DefaultHtmlCache>(); _contentEvents = context.Locate.Advanced.GetInstance <IContentEvents>(); _contentSecurityRepository = context.Locate.Advanced.GetInstance <IContentSecurityRepository>(); _contentLoader = context.Locate.Advanced.GetInstance <IContentLoader>(); _contentEvents.CreatedContent += ContentCreated; _contentEvents.MovedContent += MovedContent; _contentEvents.PublishingContent += PublishingContent; _contentEvents.PublishedContent += PublishedContent; _contentEvents.DeletedContent += DeletedContent; _contentSecurityRepository.ContentSecuritySaved += ContentSecuritySaved; }
public void Initialize(InitializationEngine context) { if (!LuceneConfiguration.Active) { return; } IContentEvents contentEvents = context.Locate.ContentEvents(); IContentSecurityRepository securityRepository = context.Locate.ContentSecurityRepository(); contentEvents.PublishedContent += new EventHandler <ContentEventArgs>(PublishContent); contentEvents.MovedContent += new EventHandler <ContentEventArgs>(MovedContent); contentEvents.DeletedContent += new EventHandler <DeleteContentEventArgs>(DeleteContent); contentEvents.DeletedContentLanguage += new EventHandler <ContentEventArgs>(DeleteContentLanguage); securityRepository.ContentSecuritySaved += new EventHandler <ContentSecurityEventArg>(UpdateSecurity); _indexingHandler.Value.Init(); _remoteContentIndexRepository.Value.Init(); DoingHealthCheck(); }
public RegisterController(IContentSecurityRepository securityRepository) { this.securityRepository = securityRepository; }
public FixScheduledJob(IContentLoader contentLoader, ReferenceConverter referenceConverter, IContentSecurityRepository contentSecurityRepository) { _contentLoader = contentLoader; _referenceConverter = referenceConverter; _contentSecurityRepository = contentSecurityRepository; }
/// <summary> /// DI Constructor /// </summary> /// <param name="contentSecurityRepository"></param> /// <param name="vulcanContentAncestorLoader"></param> public VulcanCmsIndexingModifier(IContentSecurityRepository contentSecurityRepository, IEnumerable <IVulcanContentAncestorLoader> vulcanContentAncestorLoader) { _contentSecurityDescriptor = contentSecurityRepository; _vulcanContentAncestorLoaders = vulcanContentAncestorLoader; }