0

I have looked at all articles I can find on this but I haven't found a straightforward answer.

I have a custom list....I want it so that only one user can answer a specific question item in this list, I don't mind whether other users can see this question or not (but they should be able to edit the other questions). Can someone advise me of the easiest way to do this? SharePoint foundation 2010 is platform. Would views be the easiest way?

0

Give item level permission to the users with Contribute . So that user can answer the question. For other users remove or give read permission.

  • That wont work. I need all users to be able to fill in and add items, bar just that one question (which only one person can answer). – gmisk Jun 22 '16 at 12:48
  • If it is one single question in the entire list that only one person is allowed to answer (and no other questions will ever be in this situation), then just break inheritance on that one single list item as @Sabitha S said. If you need something in which anyone can post a question, and then only a selected individual can answer it, on what basis is that person determined? Maybe your question is not clear enough because what Sabitha said sounds like the answer based on how your question is being read. – spguy Jun 22 '16 at 13:34
  • Apologies maybe I am not explaining my issue too clearly. I need one question - decision of head of operations (procede/don't procede) to only be editable by one person (on all items created on the list). Can I check how I do that for a single question for all items created in a custom list? I can see how to set permissions for the entire list, but not for 1 question when any item added. Thanks so much. Basically I need it so that 1 question in all items can only be answered by 1 specific user. – gmisk Jun 22 '16 at 15:01
  • spguy thanks for coming back to me. I don't think that will work in this case. I need everyone to be able to update all items as a case progresses (except for this one question in all cases, which can only be answered by the head of operations). Is this possible? – gmisk Jun 23 '16 at 8:43
0

Thanks for clarifying. Based on what I read now, it sounds like there is the head of operations, who is the only person who can answer any question (list item) that is added to the list. This person should be able to edit the list items, but no one else should be able to do so, but everyone can read and add items.

Based on that, you can create a very small workflow that will run automatically on newly created list items. This workflow will modify the permissions of the individual list item for which it runs, removing Contribute permissions or any other editing permission from all users (leaving read-only on all of these users) except the head of operations. This will allow the head of operations to be able to edit the list item, and still allow everyone else to read it. Use the 'Replace List Item Permissions' to handle this or a combination of 'Remove List Item Permissions' and 'Add List Item Permissions' to do it instead. This approach will work based on what you have described.

(UPDATED ANSWER)

You can edit the page of the edit form for the list item (should end in EditForm.aspx) and then add a new Web Part. Add the Content Editor web part and then drop this code inside, BUT make the changes as listed below the code.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

<script>
function modifyField(){
     var userId = _spPageContextInfo.userId;
     if(userId == 9){
          $("input[title='Manager Approval']").prop("disabled", false);
     } else {
          $("input[title='Manager Approval']").prop("disabled", true);
     }
}
setTimeout(modifyField, 100);
</script>​

Change the 'Manager Approval' in $("input[title='Manager Approval']") to the name of your field. Change the '9' in if(userId == 9) to the userId of the user who needs to be able to edit the field. So, this should be the ID of the Head of Operations.

After that, stop editing the EditForm.aspx page and then test it out. It should work, even on SP2010.

(UPDATED ANSWER - 6/29)

if you already have jQuery, then you don't need to include the jQuery link from the Google CDN. You can reference the one that you have in Site Assets as you have shown.

  1. Navigate to the Edit Form for your list. The URL will resemble the following: [SharePoint URL]/Lists/MyTestList/EditForm.aspx
  2. Click on Site Actions > Edit Page
  3. Click on 'Add a Web Part' and select the Content Editor Web Part. Add a Web Part
  4. Click on 'Click here to add new content' as shown in the screenshot above.
  5. Click on Format Text > HTML > Edit HTML Source. The dialog box will pop up for you to add the JavaScript code. Edit source to add code
  6. Save and you should be set.
  • spguy I am making a total hash of this apologies. Anyone can put up a case and edit response values whenever they want. Bar there is a specific question on all cases (approve/don't approve) which only Head of operations can put in a value for all cases (he is only person that can select a value for that one question). Is this possible? Thanks so much for your help. – gmisk Jun 23 '16 at 10:30
  • I think I understand now...each list item is a case and that approve/don't approve value (just a field/column in the list item) can only be set by the Head of Operations. You might be able to rig up some JavaScript (can use jQuery if you want) to disable that field based on the currently logged in user. So, if the current user is not the Head of Operations, then that field will be disabled, If it is the Head of Operations, then the field can be enabled. Let me know if I have now understood your question. – spguy Jun 23 '16 at 15:46
  • Spguy. I think that is what I need exactly. Do you have any idea of the code needed and where to put it? Apologies very new to sharepoint. I am guessing I need to do something on sharepoint designer – gmisk Jun 27 '16 at 8:31
  • Yep, I've updated my answer with the code. If this answers the question, please be sure to mark it as the answer. – spguy Jun 27 '16 at 21:28
  • Inserted webpart content editor at bottom of editform.aspx In "code" view i see below, do I just paste over all of it with above (with my own edits)? Thanks again for all your help! – gmisk Jun 29 '16 at 14:55

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.