Export (0) Print
Expand All

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)

public string Users { get; set; }

Property Value

Type: System.String
The users that are authorized to access the controller or action method.

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

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