public override bool?TryIsInRole(ExchangeRunspaceConfiguration rbacConfiguration) { ADRawEntry adrawEntry = this.TargetObject ?? (RbacQuery.LegacyTargetObject as ADRawEntry); if (adrawEntry != null && !(adrawEntry is ADConfigurationObject) && !(adrawEntry is OrganizationConfig)) { ScopeLocation scopeLocation = this.CmdletName.StartsWith("get-", StringComparison.OrdinalIgnoreCase) ? ScopeLocation.RecipientRead : ScopeLocation.RecipientWrite; return(new bool?(rbacConfiguration.IsCmdletAllowedInScope(this.CmdletName, this.ParameterNames ?? new string[0], adrawEntry, scopeLocation))); } return(new bool?(rbacConfiguration.IsCmdletAllowedInScope(this.QualifiedCmdletName, this.ParameterNames, this.ScopeSet))); }
internal static void VerifyIsInHoldScopes(bool isHoldEnabled, ExchangeRunspaceConfiguration runspaceConfig, ADRecipient sourceRecipient, string cmdlet, Task.TaskErrorLoggingDelegate writeErrorDelegate) { if (isHoldEnabled && !runspaceConfig.IsCmdletAllowedInScope(cmdlet, new string[] { "InPlaceHoldEnabled" }, sourceRecipient, ScopeLocation.RecipientWrite)) { writeErrorDelegate(new TaskInvalidOperationException(Strings.InPlaceHoldScopeException(sourceRecipient.DisplayName)), ErrorCategory.InvalidOperation, null); } }