Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Security / RoleService.cs / 1305376 / 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
- InheritanceUI.cs
- DataGridViewCellPaintingEventArgs.cs
- ModuleConfigurationInfo.cs
- EnumerableCollectionView.cs
- DynamicObject.cs
- XmlHierarchicalDataSourceView.cs
- UTF7Encoding.cs
- DragDeltaEventArgs.cs
- ACL.cs
- TraceSwitch.cs
- NamespaceQuery.cs
- AtomicFile.cs
- GorillaCodec.cs
- MsmqIntegrationBindingElement.cs
- RelationshipManager.cs
- DefaultValueAttribute.cs
- RoutedEventHandlerInfo.cs
- FileLogRecordHeader.cs
- ProtectedProviderSettings.cs
- HandleExceptionArgs.cs
- ProcessDesigner.cs
- SerializationStore.cs
- DataObjectCopyingEventArgs.cs
- HttpListenerPrefixCollection.cs
- Pool.cs
- DataGridPageChangedEventArgs.cs
- Module.cs
- SqlProfileProvider.cs
- MetadataItemSerializer.cs
- RIPEMD160.cs
- CSharpCodeProvider.cs
- SafeFindHandle.cs
- DesignerResources.cs
- DataPagerFieldCollection.cs
- ManagedFilter.cs
- XsdBuilder.cs
- PathFigureCollectionConverter.cs
- FormCollection.cs
- HandlerBase.cs
- TraceContextEventArgs.cs
- COM2Properties.cs
- VoiceChangeEventArgs.cs
- RecognizedPhrase.cs
- FixedPosition.cs
- AddInAdapter.cs
- CodeConstructor.cs
- DynamicValueConverter.cs
- PositiveTimeSpanValidator.cs
- SimpleBitVector32.cs
- ConfigErrorGlyph.cs
- RouteValueExpressionBuilder.cs
- AppDomain.cs
- Compiler.cs
- GridViewRowCollection.cs
- MessageHeaderException.cs
- CommunicationException.cs
- Point.cs
- GlyphRunDrawing.cs
- QueryableDataSource.cs
- ActivityStateQuery.cs
- CacheAxisQuery.cs
- ExpressionBinding.cs
- QilCloneVisitor.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- FixedHyperLink.cs
- TemplateNameScope.cs
- QilParameter.cs
- MemberProjectionIndex.cs
- TemplateContainer.cs
- RegularExpressionValidator.cs
- ReservationCollection.cs
- ping.cs
- AccessViolationException.cs
- Translator.cs
- TextBoxAutomationPeer.cs
- RegisterInfo.cs
- RawAppCommandInputReport.cs
- XmlSchemaInferenceException.cs
- BitmapEffectInput.cs
- HandleExceptionArgs.cs
- KeyToListMap.cs
- XmlNodeChangedEventArgs.cs
- TranslateTransform.cs
- DbProviderFactoriesConfigurationHandler.cs
- ButtonBaseAutomationPeer.cs
- TableItemProviderWrapper.cs
- AttributeAction.cs
- Model3D.cs
- MasterPageParser.cs
- IndicShape.cs
- Image.cs
- FactoryGenerator.cs
- GradientBrush.cs
- Calendar.cs
- MenuScrollingVisibilityConverter.cs
- HandlerBase.cs
- XPathMessageFilterElementComparer.cs
- Types.cs
- EnlistmentState.cs
- ProfileService.cs