Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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:  Microsoft.Data.Services (in Microsoft.Data.Services.dll)
[FlagsAttribute]
public enum ServiceOperationRights
Member nameDescription
AllAll rights assigned to the service operation..
AllReadAuthorization to read single or multiple data items deployed by the service operation.
NoneNo authorization to access the service operation.
OverrideEntitySetRightsOverrides entity set rights that are explicitly defined in the data service with the service operation rights.
ReadMultipleAuthorization to read multiple data items by using the service operation.
ReadSingleAuthorization to read a single data item by using the service operation.

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);
      }
  }
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.