Pergunta

When I click on Edit Page button the code below doesn't execute, but I have all permissions:

<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="ViewPages">
   <script type="text/javascript">
      document.getElementById("suiteBar").style.display = "block";
      if (document.getElementById("Ribbon") != null) {
        document.getElementById("s4-ribbonrow").style.display = "block"; 
      }
   </script>
</SharePoint:SPSecurityTrimmedControl>
Foi útil?

Solução

I've found the reason. The problem was in this condition - if (document.getElementById("Ribbon") != null) but no in SharePoint:SPSecurityTrimmedControl. Thank's everyone for your answers.

Outras dicas

Try to run this code after sharepoint UI is loaded:

_spBodyOnLoadFunctions.push(function(){
    document.getElementById("suiteBar").style.display = "block";
      if (document.getElementById("Ribbon") != null) {
        document.getElementById("s4-ribbonrow").style.display = "block"; 
      }
});
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top