This code helps you show or hide the ribbon depending on the user permission level.
Change the PermissionsString accordingly. A little googling will help !!
<Sharepoint:SPSecurityTrimmedControl ID=”SPSecurityTrimmedControl” runat=”server” PermissionsString=”AddAndCustomizePages”> <script type=”text/javascript”> document.getElementById(“s4-ribbonrow”).style.display = “block”; </script></Sharepoint:SPSecurityTrimmedControl>






