Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WebPartConnectVerb.cs
- ServiceObjectContainer.cs
- LowerCaseStringConverter.cs
- OracleParameterBinding.cs
- ObjectStateManagerMetadata.cs
- Effect.cs
- TraceEventCache.cs
- XmlSchemaElement.cs
- SafeLibraryHandle.cs
- TextServicesLoader.cs
- MetadataProperty.cs
- PasswordTextNavigator.cs
- SqlCrossApplyToCrossJoin.cs
- Rect3D.cs
- CodeTypeDelegate.cs
- Schema.cs
- ExtendedProtectionPolicy.cs
- BlurBitmapEffect.cs
- TextParagraphCache.cs
- WebPartDisplayModeCollection.cs
- FormsAuthenticationUserCollection.cs
- RegexRunnerFactory.cs
- QueryStringParameter.cs
- X509PeerCertificateAuthentication.cs
- XmlDictionaryString.cs
- EntityDataSourceContextCreatingEventArgs.cs
- SqlBuilder.cs
- TouchEventArgs.cs
- DrawingAttributesDefaultValueFactory.cs
- SkewTransform.cs
- TextBox.cs
- RegexCharClass.cs
- ObjectHandle.cs
- OutOfMemoryException.cs
- CreateUserErrorEventArgs.cs
- sapiproxy.cs
- UpdatePanelControlTrigger.cs
- LayoutManager.cs
- ObjectHandle.cs
- PrefixQName.cs
- Panel.cs
- PowerModeChangedEventArgs.cs
- StringStorage.cs
- XmlConvert.cs
- BaseUriHelper.cs
- StyleCollection.cs
- DataTemplate.cs
- MonthChangedEventArgs.cs
- SchemaObjectWriter.cs
- ComponentChangingEvent.cs
- SQLInt16Storage.cs
- SafeRightsManagementHandle.cs
- Model3DCollection.cs
- CodeMemberEvent.cs
- DataPagerFieldItem.cs
- AliasExpr.cs
- _BasicClient.cs
- AddDataControlFieldDialog.cs
- PointLight.cs
- TreeNodeBindingCollection.cs
- SqlParameter.cs
- Tracking.cs
- ModulesEntry.cs
- _AutoWebProxyScriptWrapper.cs
- OpacityConverter.cs
- WinFormsSecurity.cs
- ToolStripContentPanelRenderEventArgs.cs
- FactoryId.cs
- SqlMethodAttribute.cs
- SQLInt64Storage.cs
- CodeDirectoryCompiler.cs
- ZoneButton.cs
- ByeMessageApril2005.cs
- FontCacheUtil.cs
- ConnectionsZone.cs
- BehaviorEditorPart.cs
- XmlBinaryWriterSession.cs
- UniqueCodeIdentifierScope.cs
- MemberHolder.cs
- GifBitmapDecoder.cs
- SecurityContext.cs
- TypeSystemProvider.cs
- UIPropertyMetadata.cs
- EntityDescriptor.cs
- ComponentChangedEvent.cs
- SafeBitVector32.cs
- IEnumerable.cs
- ListBoxItemAutomationPeer.cs
- MatrixTransform.cs
- ToolboxItemAttribute.cs
- FileDataSourceCache.cs
- HttpRuntimeSection.cs
- MobileSysDescriptionAttribute.cs
- Single.cs
- GridViewDeletedEventArgs.cs
- VersionedStreamOwner.cs
- OLEDB_Util.cs
- ParentUndoUnit.cs
- BmpBitmapDecoder.cs
- PrimitiveCodeDomSerializer.cs