AuthorizationRule.Users Propriété

Définition

Obtient les utilisateurs associés à la ressource.

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

Valeur de propriété

StringCollection

Collection StringCollection contenant les utilisateurs dont l'autorisation doit être vérifiée.

Attributs

Exemples

L’exemple de code suivant montre comment utiliser cette propriété.

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

Remarques

La Users propriété est une liste d’utilisateurs qui ont accordé ou refusé l’accès à la ressource. Il doit y avoir au moins une valeur dans la Users collection de propriétés ou la Roles collection de propriétés, ou les deux.

S’applique à