转:http://xiangzhangjun2006.blog.163.com/blog/static/44140966201211715416178/
1.使用SPD打开站点,并打开母版页。默认是v4.master.[修改前注意备份]
2.找到下面的代码:
<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">
改成:<div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle"style="display:none">
3.然后上面的<div>标签的结束标签后面添加如下代码:
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server"PermissionsString="AddAndCustomizePages">
<script type="text/javascript">
document.getElementById("s4-ribbonrow").style.display = "block";
</script>
</Sharepoint:SPSecurityTrimmedControl>
4.保存母版页。
总结:以上代码的以上是只有具有AddAndCustomizePages权限的用户访问才会有Ribbon菜单。否则将看不到Ribbon菜单。