none
How to restrict user from deleting editing documents

    Question

  • Hi,

    I have created document approval process using infopath form library. If document get approved than how to restric user from deleting a document even user is author of document.

    secondly how to restrict other user to delete document .

    Pls advice.

    Thx.


    iffi

    Wednesday, February 8, 2017 5:37 AM

All replies

  • Hi imughal,

    To restrict users from deleting and editing documents, we need to remove “Delete Items” and “Edit Items” permissions from these users.


    To achieve that, we can use the Workflow to rest permissions for the item.

    Firstly, create a permission level and uncheck “Delete Items” and “Edit Items” permissions.

    Then ,create a workflow in SharePoint Designer and use the endpoint below to break inheritance on the specific item.

    <sitepath>/_api/web/lists/getbytitle('LIST TITLE')/items('ITEM ID')/breakroleinheritance(true)


    Or use the endpoint below to break inheritance on the item which you start the workflow:

    [%Workflow Context:Current Site URL%]/_api/lists/getbytitle('[%Workflow Context:List Name%]')/items([%Current Item:ID%])/breakroleinheritance(true)


    A detail article about how to set unique permissions on item level:

    http://spsite.pro/Blog/Post/3/SharePoint-2013-REST-API-%E2%80%93-How-to-set-Unique-Permissions-%28Item-Level-Permissions%29

    And an article about how to break inheritance and assign permissions for items step by step for your reference:

    http://blog.bullseyeconsulting.com/archive/2014/08/31/conditionally-set-permissions-on-new-documents-in-sharepoint-2013-workflow.aspx

    Per my test, it works in SharePoint Online.

    Best regards,

    Linda Zhang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, February 9, 2017 2:50 AM
  • Hello Imughal

    I hope you are well,

    This depends if you want to do this with code or through settings in SPO (SharePoint Online) out of the box.

    Basically you need to go to the Site Collection Root > click on Site Permissions (under Users and Permissions) > Then Click on Permission levels. 

    Here you can create your own permission template that adheres to your requirements, after that you can apply that permission anywhere in your site collection.

    Hope it helps :)

    Juan.

    Friday, February 10, 2017 6:50 AM