Aracılığıyla paylaş


AuthorizationRule.Users Özellik

Tanım

Kaynakla ilişkilendirilmiş kullanıcıları alır.

public:
 property System::Collections::Specialized::StringCollection ^ Users { System::Collections::Specialized::StringCollection ^ get(); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.CommaDelimitedStringCollectionConverter))]
[System.Configuration.ConfigurationProperty("users")]
public System.Collections.Specialized.StringCollection Users { get; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.CommaDelimitedStringCollectionConverter))>]
[<System.Configuration.ConfigurationProperty("users")>]
member this.Users : System.Collections.Specialized.StringCollection
Public ReadOnly Property Users As StringCollection

Özellik Değeri

StringCollection Yetkilendirmesinin doğrulanması gereken kullanıcıları içeren bir koleksiyon.

Öznitelikler

Örnekler

Aşağıdaki kod örneğinde bu özelliğin nasıl kullanılacağı gösterilmektedir.

 // Using the AuthorizationRuleCollection Add method.

 // Set the action property.
 authorizationRule.Action = 
    AuthorizationRuleAction.Allow;
 // Define the new rule to add to the collection.
 authorizationRule.Users.Add("userName");
 authorizationRule.Roles.Add("admin");
 authorizationRule.Verbs.Add("POST");

 // Add the new rule to the collection.
 authorizationSection.Rules.Add(authorizationRule);
' Using the AuthorizationRuleCollection Add method.
' Set the action property.
  authorizationRule.Action = _
  AuthorizationRuleAction.Allow
' Define the new rule to add to the collection.
authorizationRule.Users.Add("userName")
authorizationRule.Roles.Add("admin")
authorizationRule.Verbs.Add("POST")

' Add the new rule to the collection.
authorizationSection.Rules.Add(authorizationRule)

Açıklamalar

Users özelliği, kaynağa erişim izni verilen veya reddedilen kullanıcıların listesidir. Özellik koleksiyonunda, özellik koleksiyonunda Users veya her ikisinde Roles de en az bir değer olmalıdır.

Şunlara uygulanır