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
- VideoDrawing.cs
- RawStylusInputCustomData.cs
- BuilderPropertyEntry.cs
- SQLDoubleStorage.cs
- DbProviderFactoriesConfigurationHandler.cs
- OverflowException.cs
- HebrewCalendar.cs
- OleDbTransaction.cs
- MsmqIntegrationOutputChannel.cs
- TextBoxBase.cs
- CallbackTimeoutsElement.cs
- RadioButtonBaseAdapter.cs
- MobileSysDescriptionAttribute.cs
- ProcessHostMapPath.cs
- PostBackOptions.cs
- DataGridViewLayoutData.cs
- ServiceBehaviorAttribute.cs
- TextServicesContext.cs
- oledbmetadatacolumnnames.cs
- ArrayElementGridEntry.cs
- DrawingState.cs
- TypeSystem.cs
- RenderData.cs
- PersistChildrenAttribute.cs
- EventRecord.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- AttachedProperty.cs
- ConnectionPointCookie.cs
- ScrollEventArgs.cs
- PopupRootAutomationPeer.cs
- BitmapInitialize.cs
- Rotation3D.cs
- EventDrivenDesigner.cs
- SymLanguageType.cs
- ToolTipAutomationPeer.cs
- BitConverter.cs
- KeyInfo.cs
- LineGeometry.cs
- ClusterRegistryConfigurationProvider.cs
- TreeViewImageKeyConverter.cs
- WindowsFormsSectionHandler.cs
- CellIdBoolean.cs
- peersecurityelement.cs
- RepeatInfo.cs
- LostFocusEventManager.cs
- SynchronizedInputHelper.cs
- CustomErrorCollection.cs
- SecurityTokenException.cs
- LinqToSqlWrapper.cs
- PartialCachingControl.cs
- PageBuildProvider.cs
- WeakReadOnlyCollection.cs
- PropertyValueUIItem.cs
- ProcessThreadCollection.cs
- DllNotFoundException.cs
- SignatureTargetIdManager.cs
- XPathAncestorIterator.cs
- ReadOnlyHierarchicalDataSource.cs
- DbDeleteCommandTree.cs
- MultilineStringConverter.cs
- Process.cs
- GridViewUpdatedEventArgs.cs
- TaskHelper.cs
- SingleAnimationUsingKeyFrames.cs
- DbException.cs
- Int16AnimationBase.cs
- ConfigurationManager.cs
- TimeSpanStorage.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Encoder.cs
- tibetanshape.cs
- MediaElementAutomationPeer.cs
- PrtCap_Base.cs
- FunctionMappingTranslator.cs
- InputProviderSite.cs
- CompoundFileStorageReference.cs
- FixedTextContainer.cs
- sapiproxy.cs
- CmsInterop.cs
- SoapTypeAttribute.cs
- SqlDataAdapter.cs
- HitTestWithPointDrawingContextWalker.cs
- TargetPerspective.cs
- RuleSettings.cs
- PolicyUnit.cs
- SqlTopReducer.cs
- DataGridCaption.cs
- MemoryMappedView.cs
- ListViewDesigner.cs
- ScrollItemPattern.cs
- ClientTargetSection.cs
- DesignerToolStripControlHost.cs
- SchemaInfo.cs
- TdsParameterSetter.cs
- _OSSOCK.cs
- TextElementCollection.cs
- KeyFrames.cs
- SpotLight.cs
- MSAAEventDispatcher.cs
- OperationInvokerBehavior.cs