Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / IntSecurity.cs / 1 / 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;
#if UNUSED_CODE
private static IStackWalk _sensitiveInformation;
#endif
private static IStackWalk _controlPrincipal;
#if UNUSED_CODE
private static IStackWalk _controlEvidence;
#endif
private static IStackWalk _reflection;
private static IStackWalk _appPathDiscovery;
private static IStackWalk _controlThread;
#if UNUSED_CODE
private static IStackWalk _levelMinimal;
#endif
private static IStackWalk _levelLow;
private static IStackWalk _levelMedium;
private static IStackWalk _levelHigh;
#if UNUSED_CODE
private static IStackWalk _levelUnrestricted;
#endif
//
// 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;
}
}
#if UNUSED_CODE
internal static IStackWalk SensitiveInformation {
get {
if (_sensitiveInformation == null)
_sensitiveInformation = new EnvironmentPermission(PermissionState.Unrestricted);
Debug.Trace("Permissions", "SensitiveInformation");
return _sensitiveInformation;
}
}
#endif
internal static IStackWalk ControlPrincipal {
get {
if (_controlPrincipal == null)
_controlPrincipal = new SecurityPermission(SecurityPermissionFlag.ControlPrincipal);
Debug.Trace("Permissions", "ControlPrincipal");
return _controlPrincipal;
}
}
#if UNUSED_CODE
internal static IStackWalk ControlEvidence {
get {
if (_controlEvidence == null)
_controlEvidence = new SecurityPermission(SecurityPermissionFlag.ControlEvidence);
Debug.Trace("Permissions", "ControlEvidence");
return _controlEvidence;
}
}
#endif
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;
}
}
#if UNUSED_CODE
internal static IStackWalk AspNetHostingPermissionLevelMinimal {
get {
if (_levelMinimal == null)
_levelMinimal = new AspNetHostingPermission(AspNetHostingPermissionLevel.Minimal);
Debug.Trace("Permissions", "AspNetHostingPermissionLevelMinimal");
return _levelMinimal;
}
}
#endif
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;
}
}
#if UNUSED_CODE
internal static IStackWalk AspNetHostingPermissionLevelUnrestricted {
get {
if (_levelUnrestricted == null)
_levelUnrestricted = new AspNetHostingPermission(AspNetHostingPermissionLevel.Unrestricted);
Debug.Trace("Permissions", "AspNetHostingPermissionLevelUnrestricted");
return _levelUnrestricted;
}
}
#endif
// Parameterized permissions
internal static IStackWalk FileReadAccess(String filename) {
Debug.Trace("Permissions", "FileReadAccess(" + filename + ")");
return new FileIOPermission(FileIOPermissionAccess.Read, 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;
#if UNUSED_CODE
private static IStackWalk _sensitiveInformation;
#endif
private static IStackWalk _controlPrincipal;
#if UNUSED_CODE
private static IStackWalk _controlEvidence;
#endif
private static IStackWalk _reflection;
private static IStackWalk _appPathDiscovery;
private static IStackWalk _controlThread;
#if UNUSED_CODE
private static IStackWalk _levelMinimal;
#endif
private static IStackWalk _levelLow;
private static IStackWalk _levelMedium;
private static IStackWalk _levelHigh;
#if UNUSED_CODE
private static IStackWalk _levelUnrestricted;
#endif
//
// 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;
}
}
#if UNUSED_CODE
internal static IStackWalk SensitiveInformation {
get {
if (_sensitiveInformation == null)
_sensitiveInformation = new EnvironmentPermission(PermissionState.Unrestricted);
Debug.Trace("Permissions", "SensitiveInformation");
return _sensitiveInformation;
}
}
#endif
internal static IStackWalk ControlPrincipal {
get {
if (_controlPrincipal == null)
_controlPrincipal = new SecurityPermission(SecurityPermissionFlag.ControlPrincipal);
Debug.Trace("Permissions", "ControlPrincipal");
return _controlPrincipal;
}
}
#if UNUSED_CODE
internal static IStackWalk ControlEvidence {
get {
if (_controlEvidence == null)
_controlEvidence = new SecurityPermission(SecurityPermissionFlag.ControlEvidence);
Debug.Trace("Permissions", "ControlEvidence");
return _controlEvidence;
}
}
#endif
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;
}
}
#if UNUSED_CODE
internal static IStackWalk AspNetHostingPermissionLevelMinimal {
get {
if (_levelMinimal == null)
_levelMinimal = new AspNetHostingPermission(AspNetHostingPermissionLevel.Minimal);
Debug.Trace("Permissions", "AspNetHostingPermissionLevelMinimal");
return _levelMinimal;
}
}
#endif
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;
}
}
#if UNUSED_CODE
internal static IStackWalk AspNetHostingPermissionLevelUnrestricted {
get {
if (_levelUnrestricted == null)
_levelUnrestricted = new AspNetHostingPermission(AspNetHostingPermissionLevel.Unrestricted);
Debug.Trace("Permissions", "AspNetHostingPermissionLevelUnrestricted");
return _levelUnrestricted;
}
}
#endif
// Parameterized permissions
internal static IStackWalk FileReadAccess(String filename) {
Debug.Trace("Permissions", "FileReadAccess(" + filename + ")");
return new FileIOPermission(FileIOPermissionAccess.Read, 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
- Stack.cs
- ClaimTypes.cs
- CollectionViewGroup.cs
- httpstaticobjectscollection.cs
- PathTooLongException.cs
- NamespaceQuery.cs
- EventDescriptor.cs
- DetailsViewUpdateEventArgs.cs
- MdbDataFileEditor.cs
- QueryContinueDragEventArgs.cs
- ColumnHeaderConverter.cs
- DesignerDataTableBase.cs
- ResourceDictionaryCollection.cs
- ColorConverter.cs
- TextureBrush.cs
- WebPartDisplayModeEventArgs.cs
- XmlMembersMapping.cs
- EventRecordWrittenEventArgs.cs
- UnsupportedPolicyOptionsException.cs
- WebPartPersonalization.cs
- Enlistment.cs
- Positioning.cs
- TextTreeExtractElementUndoUnit.cs
- XsltInput.cs
- DefaultCommandConverter.cs
- BitmapCodecInfoInternal.cs
- ResXFileRef.cs
- SqlMethodAttribute.cs
- TransformCollection.cs
- RangeValueProviderWrapper.cs
- XmlMemberMapping.cs
- ParseNumbers.cs
- WsdlHelpGeneratorElement.cs
- GAC.cs
- UInt64Converter.cs
- PanelContainerDesigner.cs
- BuildResultCache.cs
- DocumentsTrace.cs
- Converter.cs
- OracleDataReader.cs
- SystemResourceKey.cs
- PassportPrincipal.cs
- SqlRowUpdatingEvent.cs
- smtppermission.cs
- SegmentTree.cs
- RoutedEventValueSerializer.cs
- SchemaElementDecl.cs
- GorillaCodec.cs
- GetUserPreferenceRequest.cs
- DebugTraceHelper.cs
- BaseHashHelper.cs
- FlowDocumentReader.cs
- TextPointer.cs
- WCFServiceClientProxyGenerator.cs
- XmlBaseWriter.cs
- Brush.cs
- FigureHelper.cs
- MetadataPropertyAttribute.cs
- FontNamesConverter.cs
- OperationInfoBase.cs
- ArraySegment.cs
- WindowsComboBox.cs
- cryptoapiTransform.cs
- JavaScriptSerializer.cs
- JsonClassDataContract.cs
- HttpMethodConstraint.cs
- AnnotationComponentManager.cs
- ToolStripLabel.cs
- MachineKeySection.cs
- DataGridViewColumnTypeEditor.cs
- AnnotationMap.cs
- XmlAnyElementAttribute.cs
- ImageAttributes.cs
- DistinctQueryOperator.cs
- NativeMethods.cs
- ConnectionManagementElement.cs
- BaseCollection.cs
- Pointer.cs
- SocketAddress.cs
- WriterOutput.cs
- TextEditorParagraphs.cs
- EmbeddedMailObjectsCollection.cs
- ConcatQueryOperator.cs
- LinqDataSourceDisposeEventArgs.cs
- DependencyPropertyConverter.cs
- DynamicValidatorEventArgs.cs
- GeneralTransform2DTo3DTo2D.cs
- IconEditor.cs
- PnrpPeerResolverElement.cs
- InvalidFilterCriteriaException.cs
- MessageQueuePermissionEntry.cs
- SchemaImporterExtensionElementCollection.cs
- DbXmlEnabledProviderManifest.cs
- CheckableControlBaseAdapter.cs
- InvalidDocumentContentsException.cs
- MD5.cs
- ComponentSerializationService.cs
- BidPrivateBase.cs
- SHA1Managed.cs
- CanonicalFontFamilyReference.cs