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

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.
主站蜘蛛池模板: 额济纳旗| 化州市| 离岛区| 黄骅市| 河东区| 鄄城县| 灵川县| 新源县| 临高县| 科技| 六安市| 乌兰浩特市| 自贡市| 遵义县| 汝阳县| 宁海县| 五原县| 昭通市| 贵阳市| 维西| 定陶县| 龙岩市| 曲沃县| 渭南市| 桐梓县| 德安县| 大埔区| 吉安县| 桐城市| 怀安县| 周口市| 宁晋县| 大渡口区| 拉萨市| 天镇县| 石景山区| 靖江市| 秀山| 贵溪市| 淮阳县| 裕民县|