แก้ไข

แชร์ผ่าน


ServiceOperationRights Enum

Definition

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

This enumeration supports a bitwise combination of its member values.

public enum class ServiceOperationRights
[System.Flags]
public enum ServiceOperationRights
[<System.Flags>]
type ServiceOperationRights = 
Public Enum ServiceOperationRights
Inheritance
ServiceOperationRights
Attributes

Fields

Name Value Description
None 0

No authorization to access the service operation.

ReadSingle 1

Authorization to read a single data item by using the service operation.

ReadMultiple 2

Authorization to read multiple data items by using the service operation.

All 3

All rights assigned to the service operation.

AllRead 3

Authorization to read single or multiple data items deployed by the service operation.

OverrideEntitySetRights 4

Overrides entity set rights that are explicitly defined in the data service with the service operation rights.

Examples

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);  
      }  
  }  
}  

Applies to