مكسرات (صحيح) ليس له أي تأثير على المستند مجموعة المجلدات الفرعية

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/91411

سؤال

أحاول كسر الميراث على مجلد فرعي ضمن تعيين مستند باستخدام التعليمات البرمجية التالية.بعد تشغيل الرمز وفحص المجلد الفرعي لمجموعة المستند، يمكنني أن أرى أنه لا يزال يرث من الوالد.هل يمكن لأي شخص أن يرى ما هو الخطأ هنا؟ giveacodicetagpre.

هل كانت مفيدة؟

المحلول

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.

"

نصائح أخرى

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?

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top