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
- StateDesigner.cs
- DBSqlParser.cs
- XmlIgnoreAttribute.cs
- EntityException.cs
- BackStopAuthenticationModule.cs
- LabelExpression.cs
- CmsInterop.cs
- TreeNodeEventArgs.cs
- Thumb.cs
- HtmlInputHidden.cs
- TimeManager.cs
- Compress.cs
- BaseTreeIterator.cs
- PageParserFilter.cs
- ConstructorNeedsTagAttribute.cs
- RegexCapture.cs
- DESCryptoServiceProvider.cs
- SqlBuffer.cs
- SizeLimitedCache.cs
- OdbcDataAdapter.cs
- ContractNamespaceAttribute.cs
- milexports.cs
- UrlPath.cs
- MSHTMLHostUtil.cs
- TextSimpleMarkerProperties.cs
- FontDriver.cs
- sitestring.cs
- HyperLinkColumn.cs
- ScrollProviderWrapper.cs
- ConfigurationStrings.cs
- HtmlAnchor.cs
- NotifyCollectionChangedEventArgs.cs
- TextChange.cs
- CurrentChangedEventManager.cs
- DataPagerFieldCollection.cs
- ResourcesBuildProvider.cs
- VersionPair.cs
- SiteOfOriginContainer.cs
- StyleSheetComponentEditor.cs
- StringCollection.cs
- SupportsPreviewControlAttribute.cs
- ChildrenQuery.cs
- ICspAsymmetricAlgorithm.cs
- AbandonedMutexException.cs
- GenericWebPart.cs
- NumberFunctions.cs
- HttpCookieCollection.cs
- PriorityQueue.cs
- InputReportEventArgs.cs
- Serializer.cs
- Int64Animation.cs
- XpsDocumentEvent.cs
- X509DefaultServiceCertificateElement.cs
- NativeMethods.cs
- EntityWithKeyStrategy.cs
- SQLChars.cs
- Stack.cs
- CompletionCallbackWrapper.cs
- Wildcard.cs
- ValidationSummary.cs
- MsmqHostedTransportManager.cs
- RuntimeArgumentHandle.cs
- Color.cs
- DataSourceViewSchemaConverter.cs
- JsonFormatReaderGenerator.cs
- WindowsSlider.cs
- Variable.cs
- Stack.cs
- WindowsProgressbar.cs
- ExtendedPropertyCollection.cs
- KeyTimeConverter.cs
- SafeNativeMethodsOther.cs
- DeflateStreamAsyncResult.cs
- WebPartConnectionsConfigureVerb.cs
- BaseCollection.cs
- DbResourceAllocator.cs
- MetafileHeaderWmf.cs
- UnmanagedMemoryStreamWrapper.cs
- GuidelineCollection.cs
- SamlAuthorizationDecisionStatement.cs
- DataControlFieldTypeEditor.cs
- OperationInfo.cs
- Base64WriteStateInfo.cs
- CommentAction.cs
- RenderTargetBitmap.cs
- BamlLocalizabilityResolver.cs
- SrgsDocument.cs
- ValueUtilsSmi.cs
- CellParaClient.cs
- DataGridViewRowConverter.cs
- JsonReader.cs
- Dictionary.cs
- SoapAttributeAttribute.cs
- WebPartEditVerb.cs
- ListItemParagraph.cs
- PropertyFilter.cs
- Dump.cs
- UIElementHelper.cs
- ISO2022Encoding.cs
- TextSpanModifier.cs