Ejemplo n.º 1
0
 private void SetScopeSet(object sender, EventArgs e)
 {
     if (!this.context.CanBypassRBACScope)
     {
         string   exchangeCmdletName = "";
         string[] array = null;
         if (this.context.InvocationInfo != null)
         {
             exchangeCmdletName = this.context.InvocationInfo.CommandName;
             array = this.FilterVerboseDebugParameter(this.context.InvocationInfo.UserSpecifiedParameters.Keys);
         }
         if (this.context.ExchangeRunspaceConfig != null && this.context.ExchangeRunspaceConfig.ConfigurationSettings.IsProxy)
         {
             array = (from val in array
                      where !ClientRoleEntries.ParametersForProxy.Contains(val)
                      select val).ToArray <string>();
         }
         if (this.context.ExchangeRunspaceConfig != null && this.context.UserInfo != null && this.context.CommandShell != null)
         {
             this.context.ScopeSet = this.context.ExchangeRunspaceConfig.CalculateScopeSetForExchangeCmdlet(exchangeCmdletName, array, this.context.UserInfo.CurrentOrganizationId, new Task.ErrorLoggerDelegate(this.context.CommandShell.WriteError));
         }
         if (this.context.InvocationInfo != null && this.context.InvocationInfo.IsVerboseOn && !TaskLogger.IsSetupLogging)
         {
             this.context.CommandShell.WriteVerbose(TaskVerboseStringHelper.GetScopeSetVerboseString(this.context.ScopeSet));
         }
     }
     this.CheckForExpiredSession();
 }
Ejemplo n.º 2
0
 private void SetScopeSet(object sender, EventArgs e)
 {
     if (this.CurrentTaskContext.CanBypassRBACScope)
     {
         if (this.CurrentTaskContext.UserInfo != null)
         {
             if (this.CurrentTaskContext.UserInfo.CurrentOrganizationId != null)
             {
                 this.CurrentTaskContext.ScopeSet = ScopeSet.GetOrgWideDefaultScopeSet(this.CurrentTaskContext.UserInfo.CurrentOrganizationId);
             }
             else
             {
                 this.CurrentTaskContext.ScopeSet = ScopeSet.GetOrgWideDefaultScopeSet(this.CurrentTaskContext.UserInfo.ExecutingUserOrganizationId);
             }
         }
         if (this.CurrentTaskContext.InvocationInfo != null && this.CurrentTaskContext.InvocationInfo.IsVerboseOn && !TaskLogger.IsSetupLogging)
         {
             this.CurrentTaskContext.CommandShell.WriteVerbose(TaskVerboseStringHelper.GetScopeSetVerboseString(this.CurrentTaskContext.ScopeSet));
         }
     }
 }