添加角色到用户创建的Web.config中 [英] Adding Role to User Created in Web.config

查看:161
本文介绍了添加角色到用户创建的Web.config中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net网站来处理身份验证的Web.config几个用户设置。没有进入我不使用的正式成员/角色提供商,宁可不要在此刻实现它做时间限制的细节。不过,我确实需要一个角色分配给用户的能力,使securityTrimming工作在相关菜单中的Sitemap。

I have a few users setup in the web.config of an asp.net site to handle authentication. Without getting into details I'm not using the full membership/role provider and would rather not have to implement it at the moment do to time constraints. However I do need the ability to assign a role to a user so that securityTrimming works on the sitemaps associated menus.

现在我只是在web.config几个用户的设置(我使用SHA1实际配置)

For now I just have a few users setup in the web.config (i use SHA1 in real config)

<authentication mode="Forms">
    <forms name="Auth" loginUrl="~/login.aspx" defaultUrl="~/admin/default.aspx" requireSSL="true">
    	<credentials passwordFormat="Clear">
    		<user name="admin" password="test"/>				
    	</credentials>
    </forms>
</authentication>

有没有可能也没有指定设立一个实际的角色提供一个角色在凭证部分中的一个用户或其他地方?类似的东西我怎么上面有用户的设置。

Is it possible to also assign a Role to one of the users in the credentials section or elsewhere without setting up an actual role provider? Something similar to how I have the users setup above.

推荐答案

这是无法通过的web.config做,你将需要设置成员资格提供,但使用的.exe文件来创建数据库表,整个过程在5分钟字面上需要完成!

This is not possible to do via the web.config, you will need to setup the membership provider, but using the .exe to create the database tables, the whole process literally takes under 5 minutes to complete!

这篇关于添加角色到用户创建的Web.config中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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