public void SetServiceActionAccessRule(string name, ServiceActionRights rights) { this.CheckNotSealed(); WebUtil.CheckStringArgumentNullOrEmpty(name, "name"); WebUtil.CheckServiceActionRights(rights, "rights"); if (name == "*") { this.rightsForUnspecifiedServiceAction = rights; } else { this.serviceActionRights[name] = rights; } }
public void EnableTypeAccess(string typeName) { WebUtil.CheckStringArgumentNullOrEmpty(typeName, "typeName"); this.CheckNotSealed(); if (typeName == "*") { this.accessEnabledForAllResourceTypes = true; } else { ResourceType type; if (!this.provider.TryResolveResourceType(typeName, out type) || (type == null)) { throw new ArgumentException(System.Data.Services.Strings.DataServiceConfiguration_ResourceTypeNameNotFound(typeName), "typeName"); } if (type.ResourceTypeKind != ResourceTypeKind.ComplexType) { throw new ArgumentException(System.Data.Services.Strings.DataServiceConfiguration_NotComplexType(typeName), "typeName"); } this.accessEnabledResourceTypes.Add(typeName); } }