AuthorizeAttribute.Users Property

 

Gets or sets the users that are authorized to access the controller or action method.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

public string Users { get; set; }
public:
property String^ Users {
    String^ get();
    void set(String^ value);
}
member Users : string with get, set
Public Property Users As String

Property Value

Type: System.String

The users that are authorized to access the controller or action method.

Examples

The following example shows how to limit access to a controller to only the specified users.

[Authorize(Users="Alice,Bob")]
public class RestrictedContentController : Controller
{
    . . .
}

See Also

AuthorizeAttribute Class
System.Web.Mvc Namespace

Return to top