Hide SharePoint List Columns based on User Permissions

Requirement: We have a “Requests” link in our Help Desk site. The “Status” field in the help desk requests list should be hidden when users create a new entry in the list. Same time, Status field must be visible to people in “Help desk operators” group.

So, the requirement is to hide the SharePoint List Form field based on user permissions!

Solution: How to hide SharePoint list columns based on user permissions?

Use SPServices to check whether the current user is a member of a particular group. If not,  hide the field using jQuery (or you can make the field Read-only too: How to Make SharePoint List Column Read-Only). Here are the detailed steps:

  1. Place the below script in a text file, upload to any SharePoint library of the site.
  2. Edit the NewForm.aspx, Add a content editor web part just below form fields, point the script file in CEWP and make the content editor web part hidden.
<!-- jQuery Reference. You can refer it from Layouts Folder/Doc Library too, after uploading the script. -->
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
<!-- Download SPServices from: http://sympmarc.github.io/SPServices/ Or use this CDN  -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {
  operation: "GetGroupCollectionFromUser",
  userLoginName: $().SPServices.SPGetCurrentUser(),
  async: false,
  completefunc: function(xData, Status) {
  var xml = xData.responseXML.xml;

   //If the current User does belong to the group "Service desk Operators"
    if (xml.search('Service Desk Operators') == -1)
          //   alert("No, User Doesn't Exists!");                   
          //or use: $('td.ms-formlabel:contains("Status")').parent().hide();
          //You can also use:  $('nobr:contains("Status")').closest('tr').hide();

Instead of content editor web part, You can also edit the NewForm.aspx or EditForm.aspx file and place the code under “PlaceHolderAdditionalPageHead” to hide fields in SharePoint list forms.

Here is the NewForm.aspx view for “Help Desk Operators” – Note that the “Status” field is visible.

hide sharepoint list columns based on user permissions

and here is the view for end-users: SharePoint list columns hidden based user permissions.

hide sharepoint list form fields columns based on user permissions

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

15 thoughts on “Hide SharePoint List Columns based on User Permissions

  • July 30, 2019 at 12:06 PM

    Does this script work for SharePoint Online as well

  • July 15, 2016 at 3:53 PM

    Thanks for the jQuery.
    I am getting error at completefunc: function (xData, Status), could you please help me in resolving the issue.

  • May 17, 2016 at 1:30 PM

    Hi Salaudeen Rajack,
    Thank you for this script.
    It is very good and it is workin correctly on IE.

    I have two questions:
    1. Is there any chance to make fileld readonly instead of hidding it?
    2. Why this scrip does not work at all in other browsers?

    Thanks you once again!
    Great script!

  • November 6, 2015 at 4:56 PM

    Hello Salaudeen,
    Is there a way users can only see certain company, regardless of site permissions or list permissions? first i merged various lists in one list with same columns, for example: company 1 list, company 2 list, ….company 10 list etc. Let’s say all those company list has common column called company number. Then i grouped according to company number.
    Now, can we let only certain users view/open certain groups?
    Please help.

  • October 21, 2015 at 12:49 PM

    Thanks for the workaround. However, My field doesn’t hide even though I am not member of the group. I tried putting alert() on xData (coming as “object Object” error) and xml (coming as “undefined” error). I am referring to the correct path for both *.js files. Am I doing anything wrong?

  • October 7, 2015 at 11:24 PM

    its not working in other browsers ,
    can you please provide the solution

  • August 18, 2015 at 7:07 PM

    not working in chrome or mozilla

  • July 11, 2014 at 3:18 PM

    Does this work with SharePoint 2013?

  • June 17, 2014 at 5:21 PM

    Hi Paul, Jquey works only when user is directly added to the SharePoint group. It doesn’t work when user is added to AD security group and this security group is added to SharePoint group.
    Did you ever encounter this issue?

  • October 31, 2013 at 3:03 PM


    Running the above code gets this error: Uncaught TypeError: Cannot call method ‘search’ of undefined

    Any ideas why? The error is on this line of code: if (xml.search(‘PUBLISHERS’) == -1)

    SPServices.js pulled form a Doc Lib in my site collection.

    *PUBLISHERS is the name of my group*

    Full code (All “>” pulled out of the Script tags to pass the comment validation:
    script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js”>/script
    scipt type=”text/javascript” src=”../../SiteAssets/Scripts/jquery_SPServices-2013_01.min.js”>/sript

    script type=”text/javascript”
    $(document).ready(function() {
    operation: “GetGroupCollectionFromUser”,
    userLoginName: $().SPServices.SPGetCurrentUser(),
    async: false,
    completefunc: function(xData, Status) {
    var xml = xData.responseXML.xml;

    //If the current User does belong to the group “Service desk Operators”
    if (xml.search(‘PUBLISHERS’) == -1)
    // alert(“No, User Doesn’t Exists!”);
    //or use: $(‘td.ms-formlabel:contains(“Status”)’).parent().hide();
    //You can also use: $(‘nobr:contains(“Status”)’).closest(‘tr’).hide();



    • November 2, 2013 at 5:20 PM


      Just validate the file paths of the referenced js files ( SPServices.js & jQuery.js). Not sure that the new versions of SPServices undergone changes. Try using the same version as in my code.

    • July 15, 2016 at 11:11 AM

      Thanks for providing the script.
      The IF command was not working for me as well. Jon, have you resolved this error?
      Salaudeen, could you please help me on this.

    • April 3, 2017 at 1:55 PM

      One of the lines in above code is incorrect. Replace the below line and your code will work.

      completefunc: function (xData, Status) {
      if (($(xData.responseXML).find(“Group[Name=’YourGroupName’]”).length == -1))


Leave a Reply