Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / Security / RoleService.cs / 1 / RoleService.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Security {
using System;
using System.Web.ApplicationServices;
using System.Web.Script.Services;
using System.Web.Services;
[ScriptService]
internal sealed class RoleService {
[WebMethod]
public string[] GetRolesForCurrentUser(){
ApplicationServiceHelper.EnsureRoleServiceEnabled();
return Roles.GetRolesForUser();
}
[WebMethod]
public bool IsCurrentUserInRole(string role) {
if (role == null) {
throw new ArgumentNullException("role");
}
ApplicationServiceHelper.EnsureRoleServiceEnabled();
return Roles.IsUserInRole(role);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.Security {
using System;
using System.Web.ApplicationServices;
using System.Web.Script.Services;
using System.Web.Services;
[ScriptService]
internal sealed class RoleService {
[WebMethod]
public string[] GetRolesForCurrentUser(){
ApplicationServiceHelper.EnsureRoleServiceEnabled();
return Roles.GetRolesForUser();
}
[WebMethod]
public bool IsCurrentUserInRole(string role) {
if (role == null) {
throw new ArgumentNullException("role");
}
ApplicationServiceHelper.EnsureRoleServiceEnabled();
return Roles.IsUserInRole(role);
}
}
}
// 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
- CapabilitiesUse.cs
- Point4D.cs
- PerformanceCounterPermission.cs
- WpfXamlMember.cs
- RemotingConfiguration.cs
- Module.cs
- TextViewElement.cs
- NoResizeSelectionBorderGlyph.cs
- CssStyleCollection.cs
- cryptoapiTransform.cs
- MimeFormatExtensions.cs
- DbConnectionPoolGroup.cs
- DynamicUpdateCommand.cs
- ExceptionHandlerDesigner.cs
- DataChangedEventManager.cs
- BinHexDecoder.cs
- OptimizerPatterns.cs
- ModuleConfigurationInfo.cs
- CodePageUtils.cs
- XamlGridLengthSerializer.cs
- StringUtil.cs
- Model3D.cs
- PersonalizableTypeEntry.cs
- OpCodes.cs
- ScopelessEnumAttribute.cs
- TextTreeTextElementNode.cs
- CreatingCookieEventArgs.cs
- ItemList.cs
- ApplicationContext.cs
- WebPartCatalogAddVerb.cs
- _SSPIWrapper.cs
- ContentType.cs
- WindowsStatusBar.cs
- ObjectItemNoOpAssemblyLoader.cs
- XD.cs
- ArraySegment.cs
- SimpleApplicationHost.cs
- InternalConfigRoot.cs
- Version.cs
- MemberCollection.cs
- CompiledELinqQueryState.cs
- StringDictionary.cs
- DbProviderManifest.cs
- TabletDevice.cs
- VisualStyleInformation.cs
- ScrollViewer.cs
- PositiveTimeSpanValidator.cs
- EventMetadata.cs
- ListSortDescription.cs
- CellNormalizer.cs
- StackOverflowException.cs
- MarkupWriter.cs
- XamlStackWriter.cs
- AppDomainFactory.cs
- FieldInfo.cs
- FilterableAttribute.cs
- IconHelper.cs
- UserControlCodeDomTreeGenerator.cs
- ToolStripGripRenderEventArgs.cs
- Separator.cs
- DataTrigger.cs
- XmlNavigatorFilter.cs
- FormatConvertedBitmap.cs
- Int64Storage.cs
- IndicShape.cs
- MenuItemBindingCollection.cs
- Main.cs
- BitmapImage.cs
- Maps.cs
- DataMisalignedException.cs
- FaultFormatter.cs
- ResourceProviderFactory.cs
- DBAsyncResult.cs
- ControlBuilderAttribute.cs
- SoapAttributes.cs
- XPathNavigator.cs
- MulticastDelegate.cs
- DataGridViewHitTestInfo.cs
- TdsEnums.cs
- DbBuffer.cs
- ProcessThread.cs
- ControlBindingsCollection.cs
- XmlTextAttribute.cs
- BindingMemberInfo.cs
- SoapAttributeOverrides.cs
- MonthCalendar.cs
- BinaryFormatter.cs
- WebPartAddingEventArgs.cs
- DesignTimeParseData.cs
- GPStream.cs
- ServiceElementCollection.cs
- CqlWriter.cs
- BuildManagerHost.cs
- recordstate.cs
- IDReferencePropertyAttribute.cs
- IISMapPath.cs
- NativeMethods.cs
- StorageMappingItemCollection.cs
- ToolBarButtonClickEvent.cs
- GenericIdentity.cs