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:
property String^ Users {
	String^ get();
	void set(String^ value);
}

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: