Sitecore Multi Role (Pre-Sitecore 9)

In Sitecore, a user must be associated with one or more Sitecore roles. S4S has a way to map a Salesforce Contact (or Lead) to Sitecore so the individual has one or more roles (Multi-Roles). The primary way to do this is called Multi-Role: Sitecore role(s) are selected from within the Contact or Lead record. The role selections can be made using a Salesforce Picklist, Multi-Select Picklist or checkboxes.

About Single-Role and Other Role Mapping Options

S4S provides an alternative to Multi-Role called Single-Role. This approach maps Sitecore roles to Salesforce Account names so any contacts that belong to an Account will appear in Sitecore as belonging to a Sitecore role with the Account name. If neither Single-Role or Multi-Role works for your business requirement, you can dispense with overriding the role provider and use a Sitecore role but still have the membership and profile data in Salesforce. More options that involve some development effort are also possible with S4S.   

Configuring Multi-Role

This section covers the additional steps to set up Multi-Role role support for all Salesforce editions. The Multi-Role package requires a custom field to be added which will map a Contact and/or a Lead (representing users in Sitecore) to Sitecore role/roles. This can be done via a checkbox, picklist or multi-select picklist.

Navigate to Setup » Build » Customize » Contacts » Fields or to set-up Lead navigate to Setup » Build » Customize » Leads » Fields. Within the fields page navigate to the Contact or Lead Custom Fields & Relationships section

Customising Contact Fields

The custom field API name should be the same as the value of 'roleFieldName' given in the web.config file. In this case the API name will be "Sitecore_Role__c".

<add name="salesforce" type="FuseIT.Sitecore.SalesforceSecurityProvider.SalesforceContactRoleProvider, FuseIT.Sitecore.SalesforceSecurityProvider" roleFieldName="Sitecore_Role__c" connectionStringName="S4SConnString" readOnly="false"/>

If a multi-select picklist or picklist field is required, make the values for the picklist the same as the roles that are required. For example, if a requirement was to allow users to add contacts to the ‘Example Role 1’ role – we would add ‘Example Role 1’ to the list of picklist values. 

Multi-Role using multi-select picklist

If checkboxes are required, add a checkbox for each role. It is important to ensure the checkbox field label is the same as the required role name.

Multi-Role using checkboxes

Password Encryption

The password encryption checkbox is a way for Sitecore authentication to determine if the supplied password is encrypted or not. In Salesforce Enterprise and above editions the password will be encrypted when saving the Contact or Lead automatically. In all other Salesforce editions, the Contact or Lead Password will be encrypted after the first successful login into Sitecore.

Next Step

Changing the Sitecore Username (Optional) (Pre-Sitecore 9)