Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- SerializationTrace.cs
- ProxyFragment.cs
- OdbcFactory.cs
- ChineseLunisolarCalendar.cs
- Bitmap.cs
- CopyNodeSetAction.cs
- DoWhile.cs
- InputProcessorProfilesLoader.cs
- Attachment.cs
- XmlWriterSettings.cs
- TextParentUndoUnit.cs
- CalendarDay.cs
- BindableAttribute.cs
- StringWriter.cs
- Glyph.cs
- LinkTarget.cs
- FormsAuthenticationCredentials.cs
- FileLogRecord.cs
- MsiStyleLogWriter.cs
- MachineKeySection.cs
- XmlDeclaration.cs
- RecordBuilder.cs
- DataGridViewLinkCell.cs
- FileStream.cs
- HtmlInputCheckBox.cs
- XmlNode.cs
- UIHelper.cs
- WorkflowIdleBehavior.cs
- EntityCodeGenerator.cs
- SplitContainer.cs
- BindingList.cs
- RegularExpressionValidator.cs
- TextViewDesigner.cs
- ComplexLine.cs
- RemoteTokenFactory.cs
- WindowsContainer.cs
- UnsafeNativeMethods.cs
- CmsInterop.cs
- StrongBox.cs
- TimersDescriptionAttribute.cs
- ReflectionTypeLoadException.cs
- MouseGestureValueSerializer.cs
- LiteralLink.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- PKCS1MaskGenerationMethod.cs
- KeyFrames.cs
- odbcmetadatafactory.cs
- TemplateBindingExpression.cs
- TextBoxBase.cs
- ActivationServices.cs
- SymbolPair.cs
- SlipBehavior.cs
- DispatcherHooks.cs
- MultiSelectRootGridEntry.cs
- SystemTcpStatistics.cs
- SubMenuStyle.cs
- HttpListenerException.cs
- UpdateManifestForBrowserApplication.cs
- ListView.cs
- ColumnReorderedEventArgs.cs
- ReachIDocumentPaginatorSerializer.cs
- ConsumerConnectionPointCollection.cs
- ClientData.cs
- _WinHttpWebProxyDataBuilder.cs
- TextDecorationUnitValidation.cs
- ModifiableIteratorCollection.cs
- ZipIOCentralDirectoryBlock.cs
- ApplicationCommands.cs
- TextServicesLoader.cs
- InvokeBase.cs
- _AcceptOverlappedAsyncResult.cs
- MimeFormatter.cs
- Listbox.cs
- NameTable.cs
- RawStylusInputCustomDataList.cs
- QueryHandler.cs
- XmlDsigSep2000.cs
- EarlyBoundInfo.cs
- Debugger.cs
- HybridDictionary.cs
- OleDbSchemaGuid.cs
- MetaType.cs
- DateTimeFormatInfo.cs
- ListViewCommandEventArgs.cs
- X509CertificateInitiatorClientCredential.cs
- MenuAutomationPeer.cs
- ToolStripControlHost.cs
- EnumValAlphaComparer.cs
- DeploymentSection.cs
- XsltContext.cs
- DataGridViewRowPostPaintEventArgs.cs
- DrawingImage.cs
- VisualState.cs
- QuaternionRotation3D.cs
- SamlConditions.cs
- CommonObjectSecurity.cs
- PropertyKey.cs
- RuleSettingsCollection.cs
- DataGridViewSelectedCellCollection.cs
- SystemWebExtensionsSectionGroup.cs