在asp.net中应用角色 [英] Appling roles in asp.net

查看:73
本文介绍了在asp.net中应用角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用ASP.net配置的情况下将角色应用于代码中的用户?是否可以在没有通过每个用户的用户表中完成。我在一个表中有5000个用户,在另一个表中有相同的内容。

How can I apply role to users within the code without using ASP.net config? Can it be done to a table of users with out going through each one. I have like 5000 users in one table and the same in another.

推荐答案

如何在不使用ASP.net配置的情况下将角色应用于代码中的用户?

我假设您不想在web.config中嵌入用户名,密码和成员资格信息。您可以使用提供者模型来安排身份验证和授权,它消除了大部分的驴工作

这里有一个关于SQL服务器的好系列 [ ^ ]。在这种情况下,您可以对数据库运行SQL以设置每个人。我认为这回答了你问题的其他部分,但我并不完全清楚我理解它。



还有其他提供商可以使用.net,所以你不限于SQL,您可以扩展它们甚至实现自己的。
How can I apply role to users within the code without using ASP.net config?
I assume you don''t want to embed the username, passwords and membership information inside the web.config. You can use the provider model to arrange authentication & authorization, it takes away much of the donkey work
There is a good series on doing this with SQL server here[^]. In this case you can run SQL against the database to set everyone up. I think that answers the other parts of your question, but I''m not fully clear I understand it.

There are other providers available with .net, so you are not restricted to SQL, you can extend these and even implement your own.


这篇关于在asp.net中应用角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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