public void Process(SecurityTemplate securityRule) { switch (securityRule.PendingAction) { case ChildPendingAction.Create: Create(securityRule); break; case ChildPendingAction.Update: Update(securityRule); break; case ChildPendingAction.Delete: Delete(securityRule.DataID); break; } // Path may have been deleted outside of the application. if (securityRule.RelativePathExists(ServerConfig.WebsiteDirectory) && !securityRule.UsingIisIdenityWhileIisSiteDisabled()) { // Syncronise even if action is none (fs may be out of date). SyncronizeFileSystem(securityRule); } }
private void enforceConstraints(SecurityTemplate securityTemplate) { if (!RelativePathExists(securityTemplate.WebsiteID, securityTemplate.RelativePath)) { string fullPath = getFullPath( securityTemplate.WebsiteID, securityTemplate.RelativePath); throw new Exception( "The Windows file system path '" + fullPath + "' does not exist."); } if (!securityTemplate.UsingIisIdenityWhileIisSiteDisabled()) { if (string.IsNullOrEmpty(securityTemplate.Username)) { if (securityTemplate.UseIisIdentity) { throw new Exception( "Security template is set to use IIS identity, but " + "the username for this identity is null or empty."); } else { throw new Exception( "The username property of the security template cannot be null."); } } if (!UserExists(securityTemplate.Username)) { throw new Exception( "There is no Windows user with username '" + securityTemplate.Username + "'."); } } }