0

I have a requirement where I have to disable a list item after it has been edited and save event has been called. I want to make that item not editable again. I'm trying jQuery but I'm only successful in disabling fields one by one. So I would like some help in this please?

  • 1
    You can use event receiver on edit item and implement code for break inheritance and remove permission for that item. – Gopal Zadafiya Jul 16 '18 at 7:25
  • I wasn't looking at using deployed solution, I would like a js approach for this? Can you offer an alternative js solution?? – Vusi85 Jul 16 '18 at 7:31
3

The another option can be to create new permission level in your site.

  1. From the site settings page, click the Site permissions link, then from the settings menu, click the "Permission Levels" menu item
  2. Click on the Contribute permission level, and scroll to the bottom of the page. Click the Copy Permission Level button to take a copy of it.
  3. Call the new copy of the permission level "CreateButNotEdit" or something similar.
  4. Uncheck all the checkboxes in the list permissions, except for "Add Items" and "View Items" and "View Application Pages"
  5. Click the create button to save the new permission level.
  6. Go to your list and Manage Permissions for your list
  7. Break the inheritance of permissions for the list, if necessary
  8. Add a group, or click a group name or user to modify their permissions
  9. Assign the groups you wish to be able to create but not edit items the "CreateButNotEdit", and "Read" permission
  10. Done.

Reference: permission to create list items but not edit them

1

You need to find out which items are updated, can be done by comparing Created and Modified (dates). Newly created items have same Created = Modified dates. However, updated items will have their Modified > Created.

Using the logic above and client side rending and JSlink, one can enable/disable items.

http://www.suhail.cloud/2014/09/client-side-rendering-using-jslink-post_30.html

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.