Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / xsp / System / Web / Util / Permission.cs / 1 / Permission.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * * Copyright (c) 1998-1999, Microsoft Corporation * */ namespace System.Web.Util { using System.Security.Permissions; using System.Security; using System.Data.SqlClient; static class Permission { internal static bool HasSqlClientPermission() { NamedPermissionSet permissionset = HttpRuntime.NamedPermissionSet; // If we don't have a NamedPermissionSet, we're in full trust if (permissionset == null) return true; // Check that the user has unrestricted SqlClientPermission IPermission allowedPermission = permissionset.GetPermission(typeof(SqlClientPermission)); if (allowedPermission == null) { return false; } IPermission askedPermission = null; try { askedPermission = new SqlClientPermission(PermissionState.Unrestricted); } catch { return false; } return askedPermission.IsSubsetOf(allowedPermission); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* * * Copyright (c) 1998-1999, Microsoft Corporation * */ namespace System.Web.Util { using System.Security.Permissions; using System.Security; using System.Data.SqlClient; static class Permission { internal static bool HasSqlClientPermission() { NamedPermissionSet permissionset = HttpRuntime.NamedPermissionSet; // If we don't have a NamedPermissionSet, we're in full trust if (permissionset == null) return true; // Check that the user has unrestricted SqlClientPermission IPermission allowedPermission = permissionset.GetPermission(typeof(SqlClientPermission)); if (allowedPermission == null) { return false; } IPermission askedPermission = null; try { askedPermission = new SqlClientPermission(PermissionState.Unrestricted); } catch { return false; } return askedPermission.IsSubsetOf(allowedPermission); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CardSpaceSelector.cs
- RowBinding.cs
- RootCodeDomSerializer.cs
- MatrixIndependentAnimationStorage.cs
- FixedDocument.cs
- DynamicPropertyHolder.cs
- StorageScalarPropertyMapping.cs
- ReliabilityContractAttribute.cs
- BindingsCollection.cs
- followingsibling.cs
- IdentityModelStringsVersion1.cs
- HttpHeaderCollection.cs
- ReachSerializerAsync.cs
- JsonReaderWriterFactory.cs
- MarginCollapsingState.cs
- WindowsFont.cs
- TemplateXamlTreeBuilder.cs
- SchemaLookupTable.cs
- MethodBuilderInstantiation.cs
- DataStreams.cs
- CacheHelper.cs
- DataObjectSettingDataEventArgs.cs
- PaperSource.cs
- ProfileEventArgs.cs
- DbProviderFactory.cs
- PlatformCulture.cs
- MasterPageBuildProvider.cs
- HtmlPanelAdapter.cs
- ReachPageContentSerializer.cs
- WindowsFormsDesignerOptionService.cs
- ContentFileHelper.cs
- CommandManager.cs
- XPathNavigator.cs
- ColorTransformHelper.cs
- Transaction.cs
- ListViewInsertionMark.cs
- URI.cs
- StringInfo.cs
- MetadataItem_Static.cs
- SecurityDescriptor.cs
- TextBoxAutoCompleteSourceConverter.cs
- ToolStripSettings.cs
- AnimationLayer.cs
- LinqDataSourceInsertEventArgs.cs
- ResizeGrip.cs
- Padding.cs
- httpstaticobjectscollection.cs
- SplitterCancelEvent.cs
- XmlSignificantWhitespace.cs
- FormsAuthenticationTicket.cs
- EntityClientCacheKey.cs
- MessageBuilder.cs
- CountdownEvent.cs
- SrgsRulesCollection.cs
- OrderPreservingPipeliningMergeHelper.cs
- LogSwitch.cs
- OperationResponse.cs
- ToolStripSeparatorRenderEventArgs.cs
- ParserStack.cs
- OleTxTransactionInfo.cs
- Input.cs
- ManipulationBoundaryFeedbackEventArgs.cs
- SecureUICommand.cs
- ExceptionValidationRule.cs
- ObjectViewFactory.cs
- PropertyAccessVisitor.cs
- isolationinterop.cs
- PersonalizationStateInfoCollection.cs
- Metafile.cs
- externdll.cs
- ContextMenu.cs
- ConfigurationManager.cs
- DoubleLink.cs
- TableStyle.cs
- RenameRuleObjectDialog.cs
- Vector3DIndependentAnimationStorage.cs
- StickyNoteHelper.cs
- ReadOnlyDataSource.cs
- SchemaSetCompiler.cs
- CqlIdentifiers.cs
- TextTreeTextElementNode.cs
- CompilerScopeManager.cs
- ToolStripSeparatorRenderEventArgs.cs
- ResponseStream.cs
- TreeViewItemAutomationPeer.cs
- QilReference.cs
- InputProcessorProfilesLoader.cs
- TypeSystemProvider.cs
- UInt32Converter.cs
- XmlBindingWorker.cs
- AttachedPropertyBrowsableAttribute.cs
- BackStopAuthenticationModule.cs
- InfoCardSymmetricAlgorithm.cs
- SHA512Managed.cs
- TableRow.cs
- TimeSpanStorage.cs
- XAMLParseException.cs
- WebPartMinimizeVerb.cs
- UrlMapping.cs
- ListSourceHelper.cs