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:
- Place the below script in a text file, upload to any SharePoint library of the site.
- 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.
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.
and here is the view for end-users: SharePoint list columns hidden based user permissions.