How do I order the [Authorize] attribute to connect to my own Roles
database to check for specifics roles in there?
What I know :
AuthorizeAttribute
. What I don't know :
[CustomAuthorize(Roles: "Administrator")]
checks if the current user has that role. Please, I really need help with this.
重写AuthorizeCore()
方法并返回true或false。
只需创建一个自定义RoleProvider即可使用ASP.NET标识。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.