动态管理的web.config授权? [英] Dynamically managing web.config for authorization?

查看:129
本文介绍了动态管理的web.config授权?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是CMS(N2)来管理一个新的网站。 CMS包括上传使用文件系统文件的功能(在DB不是二进制,这也是可能的,但我想用文件系统)。一些在上传目录中的子文件夹需要保护。这可以通过使用授权元素中完成(子)的web.config 作为陈述的这里

I'm using a CMS (N2) to manage a new website. The CMS includes functionality for uploading files using the filesystem (not binary in DB, which is also possible, but I want to use filesystem). Some of the subfolders in the uploads directory need to be secured. This can be done using authorization elements in (a sub) web.config as stated here.

用户和角色通过管理界面管理,由我CMS管理员进行管理。一些角色基于在网站上的特定功能动态添加。因此,我想保持我的〜/上传/ XXX 子文件夹的安全动态,以及。 什么是基于web.config中动态地管理授权好的解决办法?

Users and roles are managed through the admin interface and are managed by my CMS administrator. Some roles are added dynamically based on certain functionality in the website. Therefore I would like to keep my ~/upload/xxx subfolder security dynamic as well. What is a good solution for dynamically managing authorization based on web.config?

推荐答案

要实现这一目标将是指定&LT的一种方式,位置路径=MyFolder文件> ...< /地点&gt ; ,以打开特定文件夹的任何人

One way to accomplish this would be to specify a <location path="MyFolder">...</location> in order to open up a specific folder to anyone.

这是一个最好的做法把这些在你的web.config文件的底部,应该给你你正在寻找的灵活性。

It is a best practice to put these at the bottom of your web.config file and should give you the flexibility you are looking for.

下面是位置元素的MSDN页面:
http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx

Here's the MSDN page for the location Element: http://msdn.microsoft.com/en-us/library/b6x6shw7.aspx

祝你好运!

马蒂

这篇关于动态管理的web.config授权?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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