如何在MVC中进行自定义授权 [英] How to work on Custom Authorization in MVC

查看:66
本文介绍了如何在MVC中进行自定义授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





在我的MVC应用程序中,我想处理自定义授权属性。方案是,

我有一个用户表,其中包含管理员,支持工程师和用户等角色。在我的另一个表中,我正在为Team Lead,Developer,Group Head等用户提供角色。

现在在我的自定义授权方法中,我需要检查是否已登录user具有user的角色,如果是,那么我想检查该用户在另一个表中的角色,并且我想向用户授予访问该页面的Access权限。如何做到这一点任何人都可以帮我做这个方法。



谢谢

Hi,

In my MVC Application I want to work on Custom Authorization Attribute. The Scenario is,
I am having a users Table with the Roles like "Admin","Support Engineer" and "Users". In my another table I am having the roles for the users like "Team Lead", "Developer", "Group Head" etc.
Now in my custom Authorization method I need to check whether the logged in user has the role of user, If yes then I want to check the role of that user in another table and I want to give the Access permission to the user for Accessing that page. How to do this one can any one help me to do this method.

Thanks

推荐答案

这篇关于如何在MVC中进行自定义授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆