Exemple #1
0
        protected override void OnInitialActivate()
        {
            this.Powershell = psFactory.CreateViewModel(model.NotificationChannels.Powershell);
            this.Webhook    = whFactory.CreateViewModel(model.NotificationChannels.Webhooks);
            this.Smtp       = smtpFactory.CreateViewModel(model.NotificationChannels.Smtp);

            this.Items.Add(this.Smtp);
            this.Items.Add(this.Webhook);
            this.Items.Add(this.Powershell);

            this.ActivateItem(this.Smtp);

            this.Notifications = notificationChannelSelectionViewModelFactory.CreateViewModel(model.GlobalNotifications);
        }
Exemple #2
0
        public SecurityDescriptorTargetViewModel(SecurityDescriptorTarget model, INotificationChannelSelectionViewModelFactory notificationChannelFactory, IFileSelectionViewModelFactory fileSelectionViewModelFactory, IAppPathProvider appPathProvider, ILogger <SecurityDescriptorTargetViewModel> logger, IDialogCoordinator dialogCoordinator)
        {
            this.directory         = new ActiveDirectory();
            this.Model             = model;
            this.logger            = logger;
            this.dialogCoordinator = dialogCoordinator;

            this.Script = fileSelectionViewModelFactory.CreateViewModel(model, () => model.Script, appPathProvider.ScriptsPath);
            this.Script.DefaultFileExtension = "ps1";
            this.Script.Filter         = "PowerShell script|*.ps1";
            this.Script.NewFileContent = ScriptTemplates.AuthorizationScriptTemplate;
            this.Script.ShouldValidate = false;
            this.Notifications         = notificationChannelFactory.CreateViewModel(model.Notifications);
        }
        private async Task Initialize()
        {
            this.Notifications       = notificationChannelFactory.CreateViewModel(this.Model.Notifications);
            this.DisplayName         = this.Target;
            this.jitGroupDisplayName = this.JitAuthorizingGroup;
            await this.UpdateDisplayName();

            await this.UpdateJitGroupDisplayName();

            await this.ValidateAsync();

            this.LastModifiedBy = await this.GetNameFromSidOrDefaultAsync(this.Model.LastModifiedBy);

            this.CreatedBy = await this.GetNameFromSidOrDefaultAsync(this.Model.CreatedBy);
        }
 public async Task Initialize()
 {
     this.Notifications = notificationChannelFactory.CreateViewModel(this.channels);
     await this.ValidateAsync();
 }