How to Hide ribbon except for admin in SharePoint 2010


Scenario:
Client wanted to hide the ribbon from everyone except admin.

Solution:
1) Open your SharePoint master page
2) Add the following style in head section

<style type="text/css"> #s4-ribbonrow { display : none; }  </style>
3) Now find the start of the "s4-ribbonrow" tag and add following block before this:
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddAndCustomizePages">     <style type="text/css">         #s4-ribbonrow { display : block; }     </script> </Sharepoint:SPSecurityTrimmedControl>
4) Save the new master page and publish it.