Export (0) Print
Expand All

ServiceOperationRights Enumeration

An enumeration used to define access rights to service operations deployed by WCF Data Services.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  System.Data.Services
Assembly:  System.Data.Services (in System.Data.Services.dll)

[FlagsAttribute]
public enum class ServiceOperationRights

Member nameDescription
NoneNo authorization to access the service operation.
ReadSingleAuthorization to read a single data item by using the service operation.
ReadMultipleAuthorization to read multiple data items by using the service operation.
AllReadAuthorization to read single or multiple data items deployed by the service operation.
AllAll rights assigned to the service operation..
OverrideEntitySetRightsOverrides entity set rights that are explicitly defined in the data service with the service operation rights.

The following example sets all rights access to the service operation OrdersByCity.

namespace AccountingServiceWebApp
{
  public class AccountingService : DataService<DataModel>
  {
      public static void InitializeService(IDataServiceConfiguration config)
      {
          config.SetServiceOperationAccessRule("OrdersInCity", ServiceOperationRights.All);
      }
      public IQueryable<Orders> OrdersByCity(string city)
      {
          return this.CurrentDataSource.Orders.Where(o => o.ShippingCity == city);
      }
  }
}

.NET Framework

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft