100165431.htm

来自「C#高级编程(第三版),顶死你们。。 。up」· HTM 代码 · 共 71 行

HTM
71
字号


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
	
        14.3  基于角色的安全性
</title></head>
<body>
    <div class="area">

        

        <div class="col1">
            <div class="lineBlue">
            </div>
            <!-- title -->
            <div class="arcTitle">
                <h1>
                    <a href="../16">
                        C#高级编程(第3版)【全文连载】
                    </a>
                </h1>
                <div style="text-align: center; font-size: 15px">
                    <a href="100165431.htm">
                        14.3  基于角色的安全性
                    </a>
                </div>
                <div style="text-align: center; font-size: 15px">
                    <a class="url" href="../../default.htm">http://book.csdn.net/</a>
                    2006-10-13 14:41:00
                </div>
                <div style="margin: 0px auto; width: 700px; border: solid 1px #0b5f98;">
                    <div style="float: left; width: 16px; background-color: #0b5f98; color: White; padding: 1px;">
                        图书导读
                    </div>
                    <div style="float: right; width: 670px; text-align: left; line-height: 16pt; padding-left: 2px">
                        <!--导读-->
                        <h1 id="divCurrentNode" style="color: #b83507; width: 100%; text-align: left; font-size: 12px; padding-left: 2px">当前章节:<a href='100165431.htm'><font color='red'>14.3  基于角色的安全性</font></a></h1>
                        <div id="divRelateNode" style="padding-left: 2px">
                        <div style='float:left;width:49%'>·<a href='100165428.htm'>14.2.5  断言权限</a></div><div style='float:right;width:49%'>·<a href='100165429.htm'>14.2.6  创建代码访问权限</a></div><div style='float:left;width:49%'>·<a href='100165430.htm'>14.2.7  声明的安全性</a></div><div style='float:right;width:49%'>·<a href='100165432.htm'>14.3.1  Principal</a></div><div style='float:left;width:49%'>·<a href='100165433.htm'>14.3.2  Windows Principal</a></div><div style='float:right;width:49%'>·<a href='100165434.htm'>14.3.3  角色</a></div></div>
                    </div>
                </div>
                </div>
            <!-- main -->
            <div id="main">
                <div id="text"> <link href="css.css" rel="stylesheet" type="text/css" /><h3 style="MARGIN-TOP: 11.4pt; MARGIN-LEFT: 0cm; MARGIN-RIGHT: 0cm; FTEL: 11.4pt"><a ftel="_Toc507815611"><span lang="EN-US">14.3&nbsp; </span></a><span style="FONT-FAMILY: 楷体_GB2312">基于角色的安全</span><span style="FONT-FAMILY: 楷体_GB2312">性</span></h3>
<p class="MsoNormal"><span style="FONT-FAMILY: 宋体">如前所述,代码访问的安全性使</span><span lang="EN-US">CLR</span><span style="FONT-FAMILY: 宋体">能够在后台根据代码的证据做出智能性的决定,即决定代码是否应该运行和应该具有什么权限。除此之外,</span><span lang="EN-US">.NET</span><span style="FONT-FAMILY: 宋体">还提供了基于角色的安全性,这种安全性根据用户和他们角色的证据</span><span lang="EN-US">(</span><span style="FONT-FAMILY: 宋体">而不是关于代码的证据</span><span lang="EN-US">)</span><span style="FONT-FAMILY: 宋体">,指定代码是否能够执行某些动作。基于角色的安全性不使用堆栈。</span></p>
<p class="MsoNormal"><span style="COLOR: black; FONT-FAMILY: 宋体">基于角色的安全性可以很好地解决资源的访问问题。例如,在金融行业中,员工的角色决定了他们能够访问的信息和能够执行的操作。</span></p>
<p class="MsoNormal"><span style="FONT-FAMILY: 宋体">此外,基于角色的安全性也可以与</span><span lang="EN-US">Windows</span><span style="FONT-FAMILY: 宋体">账户、</span><span lang="EN-US">Microsoft Passport</span><span style="FONT-FAMILY: 宋体">或定制的用户目<span style="LETTER-SPACING: -0.1pt">录一起使用,以便对基于</span></span><span lang="EN-US" style="LETTER-SPACING: -0.1pt">Web</span><span style="FONT-FAMILY: 宋体; LETTER-SPACING: -0.1pt">资源的访问进行管理。例如,</span><span lang="EN-US" style="LETTER-SPACING: -0.1pt">Web</span><span style="FONT-FAMILY: 宋体; LETTER-SPACING: -0.1pt">站点可以限制用户对其内</span><span style="FONT-FAMILY: 宋体">容的访问,直到用户在那个站点注册为止,而且只有用户成为那个</span><span lang="EN-US">Web</span><span style="FONT-FAMILY: 宋体">站点的订阅者之后,才<span style="LETTER-SPACING: -0.1pt">能访问站点上的特殊内容。在众多的方法中,只有</span></span><span lang="EN-US" style="LETTER-SPACING: -0.1pt">ASP.NET</span><span style="FONT-FAMILY: 宋体; LETTER-SPACING: -0.1pt">能更容</span><span style="FONT-FAMILY: 宋体">易实现<span style="LETTER-SPACING: -0.1pt">基于角色的安全性</span>,因为许多代码都是以服务器为基础的。</span></p>
<p class="MsoNormal"><span style="COLOR: black; FONT-FAMILY: 宋体; LETTER-SPACING: 0.2pt">例如,如果要执行一个需要验证的</span><span lang="EN-US" style="COLOR: black; LETTER-SPACING: 0.2pt">Web</span><span style="COLOR: black; FONT-FAMILY: 宋体; LETTER-SPACING: 0.2pt">服务,可以使用</span><span lang="EN-US" style="COLOR: black; LETTER-SPACING: 0.2pt">Windows</span><span style="COLOR: black; FONT-FAMILY: 宋体; LETTER-SPACING: 0.2pt">的账户子系统,编写一</span><span style="COLOR: black; FONT-FAMILY: 宋体">个</span><span lang="EN-US" style="COLOR: black">Web</span><span style="COLOR: black; FONT-FAMILY: 宋体">方法。但是,要确保用户在能访问该方法的功能之前,成为某一</span><span lang="EN-US" style="COLOR: black">Windows</span><span style="COLOR: black; FONT-FAMILY: 宋体">用户组的成员。</span></p></div>
                <!-- page -->
                <div class="page" style="text-align: center">
                    <a href="100165430.htm">上一页</a>&nbsp;&nbsp;&nbsp;<a href="index.html">首页</a>&nbsp;&nbsp;&nbsp;<a href="100165432.htm">下一页</a>
                </div>
                <div style="margin: 0px auto; width: 700px; border: solid 1px #0b5f98;">
                    <div style="float: left; width: 16px; background-color: #0b5f98; color: White; padding: 1px;">
                        图书导读
                    </div>
                    <div style="float: right; width: 670px; text-align: left; line-height: 16pt; padding-left: 2px">
                        <!--导读-->
                        <h1 id="divCurrentNode2" style="color: #b83507; width: 100%; text-align: left; font-size: 12px; padding-left: 2px">当前章节:<a href='100165431.htm'><font color='red'>14.3  基于角色的安全性</font></a></h1>
                        <div id="divRealteNod2" style="padding-left: 2px">
                        <div style='float:left;width:49%'>·<a href='100165428.htm'>14.2.5  断言权限</a></div><div style='float:right;width:49%'>·<a href='100165429.htm'>14.2.6  创建代码访问权限</a></div><div style='float:left;width:49%'>·<a href='100165430.htm'>14.2.7  声明的安全性</a></div><div style='float:right;width:49%'>·<a href='100165432.htm'>14.3.1  Principal</a></div><div style='float:left;width:49%'>·<a href='100165433.htm'>14.3.2  Windows Principal</a></div><div style='float:right;width:49%'>·<a href='100165434.htm'>14.3.3  角色</a></div></div>
                    </div>
                </div>
                </div>
        </div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?