Today I need to Set items permissions dynamically into my site for more than 1000 folders.
I made a workflow which set items permissions for each person that I need (In my case it sets item permission for the collaborator, and his managers).
It takes more than 10 minutes per folder to set the permissions.
Is there any way to improve set item permission performance ?
Which action do you use to set the permissions?
Are all the folders in the same Library?
Do you use a loop to apply the permissions to each folder and is the safe looping activated? If so, does it take 10 minutes to execute a loop iteration or to execute the set permissions action only?
Is the verbose logging activated on your workflow?
All folders are in the same library.
I use a loop action to recover every manager of my employee. So in the same Workflow I have 2 query BCS.
The first one is to query every employee's logins. The second one is on the loop to recovers managers.
It takes 10 min to set permissions per folder. But I don't know if it comes from the query or the set item permission.
Thanks for your answer.
Be careful to not have more than 5000 unique permissions applied on the items (files, folders) in one library as it can have a huge impact on performance. Depending on your server ressources and as you have more than 1000 folders where you apply unique permissions, it can be the cause of the long execution time to set the permissions.
Maybe you can consider splitting the content of your library in several libraries.
If you use loops and if the safe looping is activated (which is recommended), then there's a 5 minutes (approximately) delay between each iteration. If you use a foreach, there's no delay between each iteration.
To better know which action takes a lot of time to be executed, you can maybe add a log in history list action before and after the set permission action. As it will add a lot of items if the Nintex workflow history list, don't forget to purge it after the execution of your workflow.
I have another question for you : in the workflow, before setting permissions on the folder, do you perform changes on this folder? If so, maybe a commit pending changes action is required before setting permissions.
Hope this helps,