Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Configuration / AuthorizationSection.cs / 5 / AuthorizationSection.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.Security.Principal; using System.Web.Util; using System.ComponentModel; using System.Security.Permissions; /**/ /// /// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class AuthorizationSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propRules = new ConfigurationProperty(null, typeof(AuthorizationRuleCollection), null, ConfigurationPropertyOptions.IsDefaultCollection); private bool _EveryoneAllowed = false; internal bool EveryoneAllowed { get { return _EveryoneAllowed; } } static AuthorizationSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propRules); } public AuthorizationSection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("", IsDefaultCollection = true)] public AuthorizationRuleCollection Rules { get { return (AuthorizationRuleCollection)base[_propRules]; } } protected override void PostDeserialize() { if (Rules.Count > 0) { _EveryoneAllowed = (Rules[0].Action == AuthorizationRuleAction.Allow && Rules[0].Everyone); } } internal bool IsUserAllowed(IPrincipal user, String verb) { return Rules.IsUserAllowed(user, verb); } } // class AuthorizationSection } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //Adds Authorization specific information to this section. /// ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Configuration { using System; using System.Xml; using System.Configuration; using System.Collections.Specialized; using System.Collections; using System.Globalization; using System.IO; using System.Text; using System.Security.Principal; using System.Web.Util; using System.ComponentModel; using System.Security.Permissions; /**/ /// /// [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class AuthorizationSection : ConfigurationSection { private static ConfigurationPropertyCollection _properties; private static readonly ConfigurationProperty _propRules = new ConfigurationProperty(null, typeof(AuthorizationRuleCollection), null, ConfigurationPropertyOptions.IsDefaultCollection); private bool _EveryoneAllowed = false; internal bool EveryoneAllowed { get { return _EveryoneAllowed; } } static AuthorizationSection() { // Property initialization _properties = new ConfigurationPropertyCollection(); _properties.Add(_propRules); } public AuthorizationSection() { } protected override ConfigurationPropertyCollection Properties { get { return _properties; } } [ConfigurationProperty("", IsDefaultCollection = true)] public AuthorizationRuleCollection Rules { get { return (AuthorizationRuleCollection)base[_propRules]; } } protected override void PostDeserialize() { if (Rules.Count > 0) { _EveryoneAllowed = (Rules[0].Action == AuthorizationRuleAction.Allow && Rules[0].Everyone); } } internal bool IsUserAllowed(IPrincipal user, String verb) { return Rules.IsUserAllowed(user, verb); } } // class AuthorizationSection } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.Adds Authorization specific information to this section. /// ///
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- EndpointAddressProcessor.cs
- QilTernary.cs
- SynchronizedInputProviderWrapper.cs
- FindCriteriaElement.cs
- DataTableTypeConverter.cs
- MostlySingletonList.cs
- ellipse.cs
- TagElement.cs
- ListViewInsertedEventArgs.cs
- ToolStripDropDown.cs
- SimpleRecyclingCache.cs
- XmlSchemaAnnotated.cs
- IncomingWebResponseContext.cs
- AggregatePushdown.cs
- XmlQuerySequence.cs
- SiteMapDataSourceView.cs
- ObjectResult.cs
- SqlClientPermission.cs
- StringValueSerializer.cs
- BindingElement.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- OleDbErrorCollection.cs
- RecognizerBase.cs
- FrameDimension.cs
- ReadContentAsBinaryHelper.cs
- SqlProcedureAttribute.cs
- FileStream.cs
- HyperlinkAutomationPeer.cs
- SecurityHeaderElementInferenceEngine.cs
- HtmlTableRowCollection.cs
- Configuration.cs
- X509Extension.cs
- JsonMessageEncoderFactory.cs
- System.Data_BID.cs
- ChangesetResponse.cs
- DataRowComparer.cs
- BitmapEffectCollection.cs
- InputProviderSite.cs
- AssemblyBuilderData.cs
- PropertyCollection.cs
- StorageConditionPropertyMapping.cs
- MSAAEventDispatcher.cs
- ThicknessAnimationBase.cs
- VirtualDirectoryMappingCollection.cs
- TextEditorCharacters.cs
- DbConnectionClosed.cs
- BindingExpression.cs
- RequestQueryParser.cs
- RoleManagerModule.cs
- BitmapFrame.cs
- PageAdapter.cs
- ExceptionHandlersDesigner.cs
- FastEncoderWindow.cs
- ContainerUIElement3D.cs
- XhtmlBasicImageAdapter.cs
- XmlSchemaChoice.cs
- XhtmlStyleClass.cs
- ObjectContext.cs
- OdbcConnection.cs
- List.cs
- OleDbException.cs
- TextTreeRootNode.cs
- RectAnimationBase.cs
- TableLayoutStyle.cs
- TextTreeTextBlock.cs
- ProvidePropertyAttribute.cs
- BaseProcessor.cs
- ElementAction.cs
- EditorZone.cs
- XamlValidatingReader.cs
- GeneralTransform3DGroup.cs
- QilStrConcat.cs
- RuntimeIdentifierPropertyAttribute.cs
- EventBuilder.cs
- StreamResourceInfo.cs
- PrintPageEvent.cs
- UnknownMessageReceivedEventArgs.cs
- ObjectKeyFrameCollection.cs
- ScriptingProfileServiceSection.cs
- AudienceUriMode.cs
- DataSpaceManager.cs
- TextServicesCompartment.cs
- ApplicationInterop.cs
- PermissionRequestEvidence.cs
- DeflateStream.cs
- CrossSiteScriptingValidation.cs
- LayoutTableCell.cs
- EntityDataSourceState.cs
- WebPartExportVerb.cs
- CollectionBase.cs
- PropertyConverter.cs
- CallInfo.cs
- RoutedEventConverter.cs
- File.cs
- MasterPageCodeDomTreeGenerator.cs
- XmlSchemaAttributeGroup.cs
- oledbmetadatacollectionnames.cs
- EvidenceBase.cs
- ReflectTypeDescriptionProvider.cs
- HandleRef.cs