0

I want to make a parent folder that users cannot delete but can upload, edit and delete folders and files inside the parent folder.

Right now I am able to make the parent folder and can prevent users from deleting it.

However, any item inside the parent folder cannot be deleted by the users as it is inheriting its permissions from the parent folder.

As of now the folder is empty and to allow a user to delete an item would be to change permissions on every child item created.

Is there a way of breaking inheritance from the parent folder so that any child items can be deleted by users.

0

You can use the workflow to assign unique permissions on each item added in this folder.

Start a workflow automatically when an item is created, use the endpoint below to break inheritance on the current item which the workflow is started on.

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

Use the following endpoint to assign permissions to the user.

[%Workflow Context:Current Site URL%]/_api/lists/getbytitle(‘[%Workflow Context:List Name%]’)/items(([%Current Item:ID%])/roleassignments/addroleassignment(principalid=<target principal Id>,roleDefId=1073741829)

Demos:

How to set unique permissions on item level

How to break inheritance and assign permissions for items step by step

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.