What does [Authorize(Users = “*”)] mean in asp.net mvc

后端 未结 3 771
再見小時候
再見小時候 2021-01-19 01:59

What does [Authorize(Users = \"*\")] mean in asp.net mvc.? Also please explain [Authorize(Users = \"\")] and [Authorize(Users = \"?\")].

3条回答
  •  日久生厌
    2021-01-19 02:27

    To authorize all users, just omit using the [Authorize] attribute alltogether. To authorize authenticated users, use the [Authorize] attribute. To authorize specific roles or users, that is when you'll have [Authorize (Users = "someuser")] or [Authorize (Roles = "somerole")].

提交回复
热议问题