Customized authorization attribute in MVC 4 with Roles

后端 未结 3 1926
遥遥无期
遥遥无期 2021-01-03 19:08

I have created a customized role base authorization attribute.My idea is that when a user with role name \"employee\" Log In should not be allowed to access the \"admin\" p

3条回答
  •  清歌不尽
    2021-01-03 19:37

    It seems that when authorized, you redirect to the Customer controller, for example. This controller likely has your attribute on it, and so it authorizes the user, who is seen as a customer, and redirects to the Customer controller... Which has your attribute on it, and so it authorizes the user...

    Infinite loop.

提交回复
热议问题