03-08-2017 03:00 AM
Hi all,
Is it possible to define additional custom site group ? So always when new site is created additional group {site identifier}_SpecialGroup will be also created.
Let's say my requirement is to have one folder in site, where just users with this special role should have access.
I don't want to create it manually always when new site is created.
Thanks
03-08-2017 03:44 AM
You should create a class like this:
public class SiteCreateEvent implements NodeServicePolicies.OnCreateNodePolicy {
private PolicyComponent policyComponent;
public void init() {
this.policyComponent.bindClassBehaviour(OnCreateNodePolicy.QNAME, SiteModel.TYPE_SITE, new JavaBehaviour(
this, "onCreateNode", NotificationFrequency.TRANSACTION_COMMIT));
}
@Override
public void onCreateNode(ChildAssociationRef childAssocRef) {
// Your code to create the group
}
public void setPolicyComponent(PolicyComponent policyComponent) {
this.policyComponent = policyComponent;
}
}
03-08-2017 08:16 AM
Thanks I will try
So my custom group will look like: site_{site id}_MyCustomRole and I will add it to group site_{site id}
Explore our Alfresco products with the links below. Use labels to filter content by product module.