コード例 #1
0
 /// <summary>Sets the permissions for the specified service action.</summary>
 /// <param name="name">The name of the service action for which to set permissions.</param>
 /// <param name="rights">The access rights to be granted to this action, passed as a <see cref="T:Microsoft.OData.Service.ServiceActionRights" /> value.</param>
 public void SetServiceActionAccessRule(string name, ServiceActionRights rights)
 {
     this.CheckNotSealed();
     WebUtil.CheckStringArgumentNullOrEmpty(name, "name");
     WebUtil.CheckServiceActionRights(rights, "rights");
     if (name == "*")
     {
         this.rightsForUnspecifiedServiceAction = rights;
     }
     else
     {
         // We initialize the service configuration before the action provider can be
         // loaded. We will not validate the service action names to make sure they
         // actually exist in the action provider.
         this.serviceActionRights[name] = rights;
     }
 }