次の方法で共有


AuthorizationRule.Users プロパティ

定義

リソースに関連付けられているユーザーを取得します。

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

プロパティ値

StringCollection

承認の検証が必要なユーザーが格納される StringCollection コレクション。

属性

次のコード例は、このプロパティの使用方法を示しています。

 // 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)

注釈

この Users プロパティは、リソースへのアクセスが許可または拒否されたユーザーの一覧です。 プロパティ コレクションまたはプロパティ コレクション、またはその両方に Users 少なくとも 1 つの値が Roles 必要です。

適用対象