如何创建基于客户角色的文件夹授权? [英] how to create custome role based folder authorization ?

查看:101
本文介绍了如何创建基于客户角色的文件夹授权?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii,



asp.net提供了我们创建角色的asp.net配置设置,只有我们需要创建用户名并为主题分配角色,



但是我的要求很好,我可以在asp.net配置设置中创建角色,



但是我不希望在那里创建任何用户作为我的用户名,并且各自的角色将在注册表单中保存在数据库中..



那么如何为每个用户分配基于角色的文件夹授权基于角色的用户。



因为我想在我的web.config文件中使用这样的东西,这将在文件夹内。



 <?  xml     version   =  1.0 >  
< configuration >
< system .web >
< 授权 >
< 允许 角色 = 管理员 / >
< deny < span class =code-attribute> users
= * / >
< span class =code-keyword>< / authorization >
< / system.web >
< / configuration >





我还有一个更重要的事情是我使用vs 2013而且我没有得到任何asp.net配置来创建角色。



简而言之,我只是想让它变得如此简单,当我登录时,我将检查用户角色,如果它的管理员角色,那么角色我已创建获取分配给该用户,以便配置文件可以按照文件夹

解决方案

中的内容进行访问。有关于它的无穷无尽的文章 - 所有你需要的是Google !!!

http:// msdn.microsoft.com/en-us/library/shz8h065(v=vs.110).aspx [ ^ ]

http://www.asp.net/web-forms/tutorials/security/roles/role-based-authorization-cs [ ^

Hii ,

asp.net provides asp.net configuration setting where we create role , and there only we need to create usernames and assign theme a role ,

But here my requirement is well i can create roles in asp.net configuration setting ,

but i dont want to create any users there as my usernames and there respective role will get save inside database during registration form ..

So how can assign role based folder authorization for each user based on there roles .

as i want to use somthing like this in my web.config file which will be inside folder .

<?xml version="1.0"?>
<configuration>
  <system.web>
    <authorization>
      <allow roles="Administrator"/>
      <deny users="*"/>
    </authorization>
  </system.web>
</configuration>



and there is one more important thing i am using vs 2013 and i am not getting any asp.net configuration to create roles .

"In short i just want to make it so simple that , when i logged in , i will check that users role , if its admin role , then the role i have created gets assign to that user so that config file will get accessible as per that which is present inside folder "

解决方案

There are endless articles about it - all you need is Google!!!
http://msdn.microsoft.com/en-us/library/shz8h065(v=vs.110).aspx[^]
http://www.asp.net/web-forms/tutorials/security/roles/role-based-authorization-cs[^]


这篇关于如何创建基于客户角色的文件夹授权?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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