I want to hide the side navigation from only certain users but we have been specifallly instructed to not mess with the master page. we are only allowed to use CSS or Javascript

  • Publishing feature enables on site or not? Feb 16 '17 at 3:39
  • do you want to hide Navigation from users based on permission level or any other criteria? Feb 16 '17 at 4:31
  • No need for script if you put the CSS <style> in Content Editor WebPart and use the WebPart-properties Target Audience setting to only include that WebPart for ... a targeted audience Feb 16 '17 at 11:28

You create a separate Java script file to write the logic and give reference this java script file in master page. or else you can using existing referred javascript file

    var SideMenu = {

    Hide: function (groupname) {

            url: _spPageContextInfo.webAbsoluteUrl+"/_api/Web/currentUser/groups?$filter=Title eq '"+groupname+"'",
            method: "GET",
            headers: { "Accept": "application/json; odata=verbose" },
            success: function (data) {
            error: function (data) {

    $(document).ready(function () {

Here GroupName1 you can assign your group name for which you want to hide side menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.