Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
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
{
    . . .
}
Return to top
Show:
© 2015 Microsoft