如何在网站管理中发挥作用 [英] How to have a role for management of website

查看:61
本文介绍了如何在网站管理中发挥作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
我有一个非常重要的问题,
我网站的根目录包含我的用户界面,其中有一个名为管理"的文件夹.
现在,如果用户登录到他/她的个人资料可以访问管理文件夹(即网站的管理员).
如何使用web.config防止此事件.
谢谢

hello
I have a very important question,
The root of my website contains my user interface in which I have a folder named "Management".
now if a user login to his/her profile can access to management folder(that is admin of website).
how can I prevent this event with web.config.
Thanks

推荐答案

首先,您需要为您的网站配置角色.

其次,您将需要放置web.config以允许具有管理角色的用户访问该文件夹.

它非常简单,请参见:了解ASP.NET角色和成员资格-入门教程 [ ^ ]
First you will need to configure Roles for your website.

Secondly, you will need to put web.config to allow users with management roles to access the folder.

Its quite straight forward, see this: Understanding ASP.NET Roles and Membership - A Beginner''s Tutorial[^]


您需要的是放置授权.身份验证完成后,授权用户可以访问给定页面.

看这里:
ASP.NET身份验证和授权 [ MSDN:ASP.NET授权 [
You need is to put Authorization in place. Once authentication is done, authorized users can access a given page.

look here:
ASP.NET authentication and authorization[^]
MSDN: ASP.NET Authorization[^]


这篇关于如何在网站管理中发挥作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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