开发者

Is there a preferred approach for Roles aware links in MVC 2

开发者 https://www.devze.com 2023-01-03 15:07 出处:网络
If an action has been decorated with [Authorize(Roles=\"Administrators\")] is there a way to not display the link for the currently logged in user who is not in the declared role?

If an action has been decorated with [Authorize(Roles="Administrators")] is there a way to not display the link for the currently logged in user who is not in the declared role?

It seems to me that baking a lot of if statements into the view to give this kind of "selective disclosure" is contrary to the MVC way, 开发者_高级运维but I'm not sure what the alternative is?


This was in the related questions for your question title:

"Security aware" action link?

0

精彩评论

暂无评论...
验证码 换一张
取 消