A note about synching roles in Hedgehog TDS
I recently started using the new roles synchronisation feature of Hedgehog TDS in my project, and was surprised when I found that while my roles got installed onto other environments, the settings applied to those roles did not get applied.
I noticed this issue after making an update to one of my roles and finding that no changes showed up in the TDS roles sync window. This seemed suspicious, so knowing that TDS uses Sitecore's built-in serialization mechanism I decided to serialize that role myself which revealed the following:
----role---- name: sitecore\Standard Editor ----role-in-role---- rolename: sitecore\Power User ----role-in-role---- rolename: sitecore\Admin User
In the sample above we see that this role is referenced by two other roles (
sitecore\Power User and
sitecore\Admin User), but does not include the information about the Sitecore built-in roles that it inherits from.
After seeing this, I did the same for each of the Sitecore roles which I had added to my "Standard Editor" role, and sure enough, each of those roles contained a reference to my role. Here is the contents of the "sitecore\Sitecore Client Publishing" role:
Sitecore Client Publishing.role
----role---- name: sitecore\Sitecore Client Publishing ----role-in-role---- rolename: sitecore\Sitecore Client Advanced Publishing ----role-in-role---- rolename: sitecore\Standard Editor
The obvious solution to this problem is to ensure that you include all the referenced Sitecore roles in addition to the roles you have created. For convenience, you could just follow the rule of including all roles in the TDS project. This is in contrast to the recommendation for other items and templates where you would generally avoid adding Sitecore-related things such as
How to Serialize and View Roles in Sitecore
- Open the Sitecore Desktop.
- Start > Security Tools > Role Manager.
- In the Role Manager, click "Serialize All Roles" or select a role and click "Serialize Role".
- Browse to the directory where your Sitecore instance is installed then drill down to
- You will find your serialized roles here. They are just text files so can be viewed with Notepad.
Installing roles via packages
After a brief test, I confirmed that when creating a package (from Sitecore Desktop, Start > Development Tools > Package Designer) the roles do include the referenced roles. When packaging, the roles are serialized using a different (XML) format.