sitecoresitecore7sitecore7.2sitecore-ecm

Is there a way to add a role as a member whenever a new role is created for a domain?


I am working on Sitecore ECM. Whenever a user creates a new recipient list, a new role is created containing no users in it. I want this new role to have another preexisting role as a member in it. So basically I want role 'adomain\arole' to be a member of every new role created by the ECM or else every new role created in domain 'adomin'.

I am working on Sitecore 7.2 and ECM 2.1 by the way.

Any help is greatly appreciated. thanks.


Solution

  • You can add your own handler to role:created event:

    <event name="role:created" />
    

    and then use AddRolesToRoles method to add additional role to your new role:

    RolesInRolesManager.Provider.AddRolesToRoles(memberRoles, targetRoles);