none
How to hide Setting and Action link from survey RRS feed

  • Question

  • Hi,

    I have created survey and given end user contribution rights, pls guide how can i hide "Action" and "Setting" menu link from end user.

    Thanks.


    iffi

    Monday, July 15, 2019 10:24 AM

Answers

  • Hi imughal,

    Go to Survey and click on Edit Page and Add Content Editor Web Part on that page and add the below CSS code in the Edit Source, that will hide Action & Setting bar from Survey.

    <style type="text/css">
    td.ms-toolbar:not(:first-child)
    {
       display: none !important;
    }
    </style>

    Thanks & Regards,


    sharath aluri

    • Marked as answer by imughal Friday, July 26, 2019 4:52 AM
    Monday, July 15, 2019 3:41 PM
  • Hi iffi,

    You can create a SharePoint group with the users who have contribute permission level, and use the code below:

    <script src="https://code.jquery.com/jquery-3.2.1.min.js" type="text/javascript"></script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.min.js"></script>
    
    <script language="javascript" type="text/javascript">
    
    $(document).ready(function(){
    
    $().SPServices({
    
    operation: "GetGroupCollectionFromUser",
    
    userLoginName: $().SPServices.SPGetCurrentUser(),
    
    async: false,
    
    completefunc: function (xData, Status) {
    
    if($(xData.responseXML).find("Group[Name='Contributor']").length == 1){
    
     
    
    $('td.ms-toolbar:not(:first-child)').hide();
    
     
    
    }
    
    }
    
    });
    
    });
    
    </script>

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, July 22, 2019 7:39 AM

All replies

  • Hi There ,

    You could get it done through custom JS injected into a content editor web part.

    The JS on the edit item page could be used to hide the Action and Setting menu

    Monday, July 15, 2019 1:07 PM
  • Hi imughal,

    Go to Survey and click on Edit Page and Add Content Editor Web Part on that page and add the below CSS code in the Edit Source, that will hide Action & Setting bar from Survey.

    <style type="text/css">
    td.ms-toolbar:not(:first-child)
    {
       display: none !important;
    }
    </style>

    Thanks & Regards,


    sharath aluri

    • Marked as answer by imughal Friday, July 26, 2019 4:52 AM
    Monday, July 15, 2019 3:41 PM
  • Hi iffi,

    You can use SPServices.SPGetCurrentUser() function to get the current user permission and check if it belongs to Contributor, then use CSS to hide the menu as Sharath provided.

    Reference:

    Hiding buttons of the Ribbon Bar

    Hide SharePoint List Columns based on User Permissions

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, July 16, 2019 3:57 AM
  • Hi,

    its not working, i also add directly into survey overview page but still not working. pls guide.

    Thx


    iffi

    Friday, July 19, 2019 6:20 AM
  • Hmmm, it worked on my end. i created a New Survey in SP 2016 and edit the Page and pasted the code i sent you in CEWP Edit Source that worked for me ? let me know your availability so, that i could have a look.

    Thanks & Regards,


    sharath aluri

    Friday, July 19, 2019 7:09 PM
  • Hi iffi,

    You can create a SharePoint group with the users who have contribute permission level, and use the code below:

    <script src="https://code.jquery.com/jquery-3.2.1.min.js" type="text/javascript"></script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2014.02/jquery.SPServices-2014.02.min.js"></script>
    
    <script language="javascript" type="text/javascript">
    
    $(document).ready(function(){
    
    $().SPServices({
    
    operation: "GetGroupCollectionFromUser",
    
    userLoginName: $().SPServices.SPGetCurrentUser(),
    
    async: false,
    
    completefunc: function (xData, Status) {
    
    if($(xData.responseXML).find("Group[Name='Contributor']").length == 1){
    
     
    
    $('td.ms-toolbar:not(:first-child)').hide();
    
     
    
    }
    
    }
    
    });
    
    });
    
    </script>

    Best regards,

    Grace Wang


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, July 22, 2019 7:39 AM
  • Hi iffi,

    I agree with the code provided by Grace. In addition to that code block follow the below 2 steps for best results:

    1. Add the code block as a script editor than as a content editor.
    2. Try to download the jQuery files and refer from your local library

    Hope this will solve your issue.

    If you still see the issue please let us know.

    Enjoy the SharePoint !!

    Best Regards,
    Krishna

    Please remember to mark the replies as answers if they helped.

    Thursday, July 25, 2019 3:51 AM