Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / IntSecurity.cs / 1305376 / IntSecurity.cs
namespace System.Web { using System.Web; using System.Web.Util; using System.Security; using System.Security.Permissions; internal static class InternalSecurityPermissions { private static IStackWalk _unrestricted; private static IStackWalk _unmanagedCode; private static IStackWalk _controlPrincipal; private static IStackWalk _reflection; private static IStackWalk _appPathDiscovery; private static IStackWalk _controlThread; private static IStackWalk _levelLow; private static IStackWalk _levelMedium; private static IStackWalk _levelHigh; // // Static permissions as properties, created on demand // internal static IStackWalk Unrestricted { get { if (_unrestricted == null) _unrestricted = new PermissionSet(PermissionState.Unrestricted); Debug.Trace("Permissions", "Unrestricted Set"); return _unrestricted; } } internal static IStackWalk UnmanagedCode { get { if (_unmanagedCode == null) _unmanagedCode = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); Debug.Trace("Permissions", "UnmanagedCode"); return _unmanagedCode; } } internal static IStackWalk ControlPrincipal { get { if (_controlPrincipal == null) _controlPrincipal = new SecurityPermission(SecurityPermissionFlag.ControlPrincipal); Debug.Trace("Permissions", "ControlPrincipal"); return _controlPrincipal; } } internal static IStackWalk Reflection { get { if (_reflection == null) _reflection = new ReflectionPermission(ReflectionPermissionFlag.MemberAccess); Debug.Trace("Permissions", "Reflection"); return _reflection; } } internal static IStackWalk AppPathDiscovery { get { if (_appPathDiscovery == null) _appPathDiscovery = new FileIOPermission(FileIOPermissionAccess.PathDiscovery, HttpRuntime.AppDomainAppPathInternal); Debug.Trace("Permissions", "AppPathDiscovery"); return _appPathDiscovery; } } internal static IStackWalk ControlThread { get { if (_controlThread == null) _controlThread = new SecurityPermission(SecurityPermissionFlag.ControlThread); Debug.Trace("Permissions", "ControlThread"); return _controlThread; } } internal static IStackWalk AspNetHostingPermissionLevelLow { get { if (_levelLow == null) _levelLow = new AspNetHostingPermission(AspNetHostingPermissionLevel.Low); Debug.Trace("Permissions", "AspNetHostingPermissionLevelLow"); return _levelLow; } } internal static IStackWalk AspNetHostingPermissionLevelMedium { get { if (_levelMedium == null) _levelMedium = new AspNetHostingPermission(AspNetHostingPermissionLevel.Medium); Debug.Trace("Permissions", "AspNetHostingPermissionLevelMedium"); return _levelMedium; } } internal static IStackWalk AspNetHostingPermissionLevelHigh { get { if (_levelHigh == null) _levelHigh = new AspNetHostingPermission(AspNetHostingPermissionLevel.High); Debug.Trace("Permissions", "AspNetHostingPermissionLevelHigh"); return _levelHigh; } } // Parameterized permissions internal static IStackWalk FileReadAccess(String filename) { Debug.Trace("Permissions", "FileReadAccess(" + filename + ")"); return new FileIOPermission(FileIOPermissionAccess.Read, filename); } internal static IStackWalk FileWriteAccess(String filename) { Debug.Trace("Permissions", "FileWriteAccess(" + filename + ")"); return new FileIOPermission(FileIOPermissionAccess.Write | FileIOPermissionAccess.Append, filename); } internal static IStackWalk PathDiscovery(String path) { Debug.Trace("Permissions", "PathDiscovery(" + path + ")"); return new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. namespace System.Web { using System.Web; using System.Web.Util; using System.Security; using System.Security.Permissions; internal static class InternalSecurityPermissions { private static IStackWalk _unrestricted; private static IStackWalk _unmanagedCode; private static IStackWalk _controlPrincipal; private static IStackWalk _reflection; private static IStackWalk _appPathDiscovery; private static IStackWalk _controlThread; private static IStackWalk _levelLow; private static IStackWalk _levelMedium; private static IStackWalk _levelHigh; // // Static permissions as properties, created on demand // internal static IStackWalk Unrestricted { get { if (_unrestricted == null) _unrestricted = new PermissionSet(PermissionState.Unrestricted); Debug.Trace("Permissions", "Unrestricted Set"); return _unrestricted; } } internal static IStackWalk UnmanagedCode { get { if (_unmanagedCode == null) _unmanagedCode = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); Debug.Trace("Permissions", "UnmanagedCode"); return _unmanagedCode; } } internal static IStackWalk ControlPrincipal { get { if (_controlPrincipal == null) _controlPrincipal = new SecurityPermission(SecurityPermissionFlag.ControlPrincipal); Debug.Trace("Permissions", "ControlPrincipal"); return _controlPrincipal; } } internal static IStackWalk Reflection { get { if (_reflection == null) _reflection = new ReflectionPermission(ReflectionPermissionFlag.MemberAccess); Debug.Trace("Permissions", "Reflection"); return _reflection; } } internal static IStackWalk AppPathDiscovery { get { if (_appPathDiscovery == null) _appPathDiscovery = new FileIOPermission(FileIOPermissionAccess.PathDiscovery, HttpRuntime.AppDomainAppPathInternal); Debug.Trace("Permissions", "AppPathDiscovery"); return _appPathDiscovery; } } internal static IStackWalk ControlThread { get { if (_controlThread == null) _controlThread = new SecurityPermission(SecurityPermissionFlag.ControlThread); Debug.Trace("Permissions", "ControlThread"); return _controlThread; } } internal static IStackWalk AspNetHostingPermissionLevelLow { get { if (_levelLow == null) _levelLow = new AspNetHostingPermission(AspNetHostingPermissionLevel.Low); Debug.Trace("Permissions", "AspNetHostingPermissionLevelLow"); return _levelLow; } } internal static IStackWalk AspNetHostingPermissionLevelMedium { get { if (_levelMedium == null) _levelMedium = new AspNetHostingPermission(AspNetHostingPermissionLevel.Medium); Debug.Trace("Permissions", "AspNetHostingPermissionLevelMedium"); return _levelMedium; } } internal static IStackWalk AspNetHostingPermissionLevelHigh { get { if (_levelHigh == null) _levelHigh = new AspNetHostingPermission(AspNetHostingPermissionLevel.High); Debug.Trace("Permissions", "AspNetHostingPermissionLevelHigh"); return _levelHigh; } } // Parameterized permissions internal static IStackWalk FileReadAccess(String filename) { Debug.Trace("Permissions", "FileReadAccess(" + filename + ")"); return new FileIOPermission(FileIOPermissionAccess.Read, filename); } internal static IStackWalk FileWriteAccess(String filename) { Debug.Trace("Permissions", "FileWriteAccess(" + filename + ")"); return new FileIOPermission(FileIOPermissionAccess.Write | FileIOPermissionAccess.Append, filename); } internal static IStackWalk PathDiscovery(String path) { Debug.Trace("Permissions", "PathDiscovery(" + path + ")"); return new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlNodeChangedEventArgs.cs
- SslStream.cs
- DesignerView.cs
- Pen.cs
- TypeBrowserDialog.cs
- Binding.cs
- Imaging.cs
- PeerNameResolver.cs
- PropertyManager.cs
- CustomErrorCollection.cs
- SchemaLookupTable.cs
- XmlSchemaIdentityConstraint.cs
- LinkArea.cs
- GridViewCellAutomationPeer.cs
- _ListenerResponseStream.cs
- QilGenerator.cs
- ProxyGenerationError.cs
- MappingException.cs
- ImportedNamespaceContextItem.cs
- RawStylusInputCustomDataList.cs
- ContentFileHelper.cs
- ColumnMapVisitor.cs
- OrthographicCamera.cs
- ListViewItemMouseHoverEvent.cs
- ScriptIgnoreAttribute.cs
- RecommendedAsConfigurableAttribute.cs
- TracePayload.cs
- CultureData.cs
- TraceSection.cs
- PointCollectionConverter.cs
- milrender.cs
- XmlSchemaAny.cs
- ResourceContainer.cs
- ScrollEvent.cs
- ForEachAction.cs
- QualifiedId.cs
- PropertyPushdownHelper.cs
- Button.cs
- MULTI_QI.cs
- ActivityExecutorOperation.cs
- Substitution.cs
- FixedSOMElement.cs
- XmlExceptionHelper.cs
- StringConverter.cs
- GridItemPatternIdentifiers.cs
- OleDbWrapper.cs
- RealProxy.cs
- HtmlHistory.cs
- URLIdentityPermission.cs
- PtsCache.cs
- InnerItemCollectionView.cs
- OleDbFactory.cs
- TypeDescriptorContext.cs
- RefreshPropertiesAttribute.cs
- RoutedPropertyChangedEventArgs.cs
- TextSelectionHighlightLayer.cs
- BlurEffect.cs
- BatchParser.cs
- SmtpAuthenticationManager.cs
- Rotation3DAnimationBase.cs
- NativeWindow.cs
- WorkflowExecutor.cs
- CertificateManager.cs
- UIElementAutomationPeer.cs
- StrokeNode.cs
- EntityDataSourceDataSelection.cs
- SchemaAttDef.cs
- WebPartConnectionsCancelVerb.cs
- TagNameToTypeMapper.cs
- CreatingCookieEventArgs.cs
- TypeListConverter.cs
- ColumnResizeAdorner.cs
- CharacterHit.cs
- HostingEnvironmentException.cs
- FontInfo.cs
- MonitorWrapper.cs
- SQLInt64.cs
- DeviceContext.cs
- WebColorConverter.cs
- WindowVisualStateTracker.cs
- SiteMapProvider.cs
- NotSupportedException.cs
- ProviderUtil.cs
- PointKeyFrameCollection.cs
- ScopelessEnumAttribute.cs
- EntityContainerAssociationSet.cs
- MissingFieldException.cs
- Link.cs
- StateMachineWorkflowDesigner.cs
- SpecialNameAttribute.cs
- MLangCodePageEncoding.cs
- CharacterString.cs
- AvtEvent.cs
- ReferencedCollectionType.cs
- ConfigXmlCDataSection.cs
- Vector3D.cs
- DecoderExceptionFallback.cs
- ToolboxComponentsCreatedEventArgs.cs
- DataTrigger.cs
- ImageConverter.cs