My target is to hide the ribbon for visitors. For site owners it needs to be visible. I googled around and find something like this below. Is this also working on pages or only in masterpages?
<Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddListItems">
<script type="text/javascript">
document.getElementById("s4-ribbonrow").style.display = "block";
</script>
</Sharepoint:SPSecurityTrimmedControl>
If this is not working in pages, is there some other solution to hide the ribbon only for visitors?
I am not looking for a development solution. Just something in spd or javascript or sometething?