Вопрос

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>
Это было полезно?

Решение

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.

Другие советы

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"; 
      }
});
Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top