Frage

Ich versuche, in einem Unterordner in einem Dokumentsatz mit dem folgenden Code auf einem Unterordner zu brühen.Nach dem Ausführen des Codes und der Untersuchung des Unterordners des Dokumentsatzes kann ich sehen, dass er noch vom Elternteil erbt.Kann jemand sehen, was hier falsch ist? generasacodicetagpre.

War es hilfreich?

Lösung

You'll want to use i.BreakRoleInheritance(false) on this one, instead of true.

From this: https://social.technet.microsoft.com/forums/sharepoint/en-US/313effab-a5af-4fda-b39c-37f620fe95f2/itembreakroleinheritancetrue-vs-itembreakroleinheritancefalse

"

When you call SPItem.BreakRoleInheritance(true), you are assigning the list item with unique permissions, while copying existing permissions on the list to the item. Any new permissions added to the item are only applied to the item.

When you call SPItem.BreakRoleInheritance(false), you are assigning the list item with unique permissions. Existing permissions on the list are NOT copied to the list item. Any new permissions added to the item are only applied to the item.

"

Andere Tipps

Your code should work from what I can see, haven't tested it. But you use i.BreakRoleInheritance(true); , meaning it will copy all the permissions it has before breaking the inheritance (from the parent). Are you sure it does not say "This folder has unique permissions." when you check the permission of the SubFolders in the GUI?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange
scroll top