Hello everyone!
I have in my list a column called "Comments" which contain the approvers comments from the flow.
I want to hide this column from 2 groups permission one called "Testgroup" and the other "Testmembers".
Both of these groups are not able to see the Comments column in the list.So only the others can see the related comments of the approvers, and i want to make this column read-only so nobody can edit this column.
I have tried to create a jQuery code but i didn't know how to add more groups to the function and how to make the column read-only so what would be all the code?
Here is my jQuery code:
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script><script type="text/javascript" src="http://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() {
$().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: $().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function(xData, Comments) {
var xml = xData.responseXML.xml;
//If the current User does belong to the group.
if($(xData.responseXML).find("Group[Name='Testgroup']").length != 1)
{
$('nobr:contains("Comments")').closest('tr').hide();
}
}
});
});</script>Any help will be greatly appreciated.
Thank you!