-
Notifications
You must be signed in to change notification settings - Fork 643
Provisioning Engine does not create groups in sub sites #202
Comments
Will this be fixed? Or do I need to create custom code to make it possible to create groups in subsites (when permission inheritance is turned off)? I suppose the following code (replacement for line 10) will fix this issue (not tested yet): |
Hi, |
Hi @PaoloPia, this issue does not deal with welcome pages. This issue has to do with creating groups for sub sites that aren't inheriting permissions from the root web. Please reopen it. I just checked ObjectSiteSecurity.cs and the IF's in question still exist. After speaking to some coworkers they are under the impression that the reason for the IF is because creating groups at a sub web is not a best practice but I don't quite understand the reasoning for that. Regardless, if a site template includes groups but is being provisioned as a sub web then the groups need to be created, either at the web level or at the site level. Either adding a check to see if the web inherits permission from the parent site and creating them there if it does or automatically creating the groups at the site level and then setting the site to use those permissions. I am actually working having to implement some of this anyways, so if you can provide guidance on if creating the groups at the sub web level is acceptable or if groups should only be created at the root web then I would be happy to add my changes and issue a PR. |
Oops ... I guess I wrote the comment in the wrong issue :) ... I'm sorry. Thanks for letting me know. We will come back with some feedbacks and guidance, as soon as possible. |
Thanks Paola. I have the following questions on this topic
|
My view on the topic:
|
My thoughts for number 1 in Nick's reply would be to have the BreakRoleInheritance attribute on the pnp:RoleAssignments element instead. No need to specify it for each of the groups IMO. |
|
I submitted PR #473 to handle the creation of the groups. The suggestion from Nick about adding the BreakRoleInheritance option to the schema will take me a bit longer to get completed. |
Alternative solution: Define role inheritance in Examples to preserve role inheritance:
Examples to break role inheritance and define default (associated) groups:
Breaks role inheritance and create all default groups and assign them as the corresponding associated groups (AssociatedOwnerGroup, AssociatedMemberGroup, AssociatedVisitorGroup).
Breaks role inheritance and creates only the default Owner group and assigns it as the corresponding associated group (AssociatedOwnerGroup).
Breaks role inheritance and creates only the default Owner group and default Member group and assigns them as the corresponding associated groups (AssociatedOwnerGroup, AssociatedMemberGroup). |
I actually did start down the path of putting the RoleInheritance attribute on the Security element. I ran into issues with the schema XSD's though that caused me to backtrack a bit (see pnp/PnP-Provisioning-Schema#79 for more detail if curious). I find your idea of AssociatedGroup interesting. That would negate the need for the additional Boolean I mention in the issue above. Question though, how would those elements be different than the AdditionalAdministrator, AdditionalMembers, and AdditionalVisitors elements, or could those existing elements be used in the same manner to avoid having to change the schema definition? |
For semantical reasons I created the If we use the |
What is the status around this issue? |
@haroldvandekamp - that's exactly my point. If the subsite has 'broken permissions', it should be OK to modify the root site by provisioning the groups. However, currently the only way to this is via extension, refer to my post above. |
I'm currently working on the the implementation. The moment I merge the update you will receive a notification on this thread. |
Sounds great! Looking forward to the implementation @erwinvanhunen |
Implemented it in the dev branch. See PR #752 |
In ObjectSiteSecurity.cs there is an explicit check for if the current site is a sub site or the root web and if its a sub site to not apply any of the settings defined in the section. Why is this? If a sub site isn't inheriting permissions then there shouldn't be an exclusion from creating groups for that site.
The text was updated successfully, but these errors were encountered: