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

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.
主站蜘蛛池模板: 怀来县| 济南市| 北安市| 津南区| 铜山县| 平安县| 阿拉善盟| 广饶县| 简阳市| 九寨沟县| 大同县| 保德县| 嘉荫县| 茶陵县| 来宾市| 电白县| 青河县| 任丘市| 栾城县| 安塞县| 宜都市| 天门市| 曲麻莱县| 利川市| 麻江县| 治多县| 陆河县| 东宁县| 博乐市| 诸暨市| 共和县| 永清县| 会昌县| 库车县| 武宁县| 武胜县| 镶黄旗| 孟州市| 蓝田县| 贡觉县| 阿拉善左旗|