how to hide ribbon buttons from Sharepoint 2010 page?
-
2012年8月18日 8:13
Hi All,
I am working on a SharePoint 2010 Project. I have Enterprise version of SharePoint 2010.
I want:
I want to hide the site action, browse button, page button, editing or list or library or picture tools form the ribbon. Navigation should be visible. This is only for the general users.
I did:
I have developed a visual studio 2010 state machine workflow. I was resetting the permission from Workflow. but the problem is that I have Contribute and Read permissions in Workflow. I want to assign a permission so that user can edit the item. When I am giving contribute then user has delete permission too. And on Read permission user can not edit the item.
Now I have decided a new approach:
To assign the contribute permission and hide the delete button from the ribbon and the Title column from the view. Now user can not delete the item. user will open the edit page from link given in Email and then he will click on Save button. once saved we will hide the save button from the Edit page. Same for the page which has browse and Page tabs.
The Problem:
We have tried all the workarounds found on the web. Used SPDesigner,trim control, JQuery, Script and CSS too. the result is unable to hide the browse, Page and List tools tab from the top of the page. We have worked on Master page too.
One More Point:
If a way is there to hide only for the general users. I mean all the hidden tabs and buttons should be visible for the "Full Control" or "Administrator". or if We can add "Edit" permission from Workflow then it would be good.
Please help.
Thanks,
- Khan Abubakar
全部回复
-
2012年8月20日 6:19版主
Hi ,
I understand that you want to hide ribbon buttons from SharePoint 2010 pages.
- For your first approach, you can edit the Contribute permission level to only allow users to edit items with delete item permission. In the root site of the site collection , choose Site Actions>Site Permissions>Permission Levels. Edit the Attribute permission level and uncheck ‘Delete Items’ permission .In this way when you assign users attribute permission, they cannot delete items.
- If you want to hide the Page and List Tools from the ribbon ,you can use these scripts in a content editor web part.
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function() {
$('.ms-cui-tts').style.visibility='hidden';
});
</script>
In order to show the ribbon to administrator and full controls users, you can use Jquery to get current login user and compare them with the administrator and full control users.
For more information ,please refer to these sites:
Remove Ribbon functions for non 'full control' users: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/1f58d57d-a3d9-4782-a98d-ed7d6d78e7d3/
Add login or username to a body of a page?: http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/5c9b30f7-2dd7-4a3d-940e-5246c4f58ee4/
Thanks,
Entan Ming
Entan Ming
TechNet Community Support
- 已标记为答案 Entan MingMicrosoft Contingent Staff, Moderator 2012年8月29日 11:32
-
2013年1月10日 19:56this did absolutely nothing to hide anything for me!
- 已编辑 CrjangelFG 2013年1月10日 19:56

