官术网_书友最值得收藏!

Custom authorization filters

To implement a custom authorization filter, we need to create a class that derives either AuthorizeAttribute, AuthorizationFilterAttribute, or IAuthorizationFilter.

  • AuthorizeAttribute: An action is authorized based on the current user and the user's roles.
  • AuthorizationFilterAttribute: Synchronous authorization logic is applied and it may not be based on the current user or role.
  • IAuthorizationFilter: Both AuthorizeAttribute and AuthorizationFilterAttribute implement IAuthorizationFilter. IAuthorizationFilter is to be implemented if advanced authorization logic is required.
主站蜘蛛池模板: 潞西市| 老河口市| 牟定县| 清远市| 揭东县| 辉南县| 福建省| 贵德县| 汉源县| 兰州市| 碌曲县| 双峰县| 莱芜市| 大丰市| 汝城县| 安国市| 吉首市| 雅江县| 贺兰县| 屏南县| 星子县| 霍城县| 宁波市| 康平县| 额敏县| 黎平县| 兴海县| 安吉县| 合阳县| 嘉禾县| 沈阳市| 永善县| 大竹县| 湘潭县| 张家港市| 通许县| 廉江市| 迁西县| 西乌| 濮阳市| 如东县|