Updating Security Cache
Updating Security Cache
Coveo for Sitecore automatically manages a security cache between Sitecore and the Coveo Platform. It’s fully refreshed by default each night to synchronize security identities from Sitecore to the Coveo Platform.
A Sitecore event triggers specific entity updates immediately when a change affecting users and roles occurs in Sitecore. It’s possible to manually trigger this update from the Sitecore Control Panel or through the Security section of the Command Center (see Understanding the Indexing Manager).
A Sitecore event triggers specific entity updates immediately when a change affecting users and roles occurs in Sitecore. It’s possible to manually trigger this update from the Sitecore Control Panel.
Sitecore User and Role Events
Sitecore triggers many events when changes are made to the entities. Coveo for Sitecore hooks itself to these events by default, according to the following table.
Event | Handler |
---|---|
user:created | OnUserCreated |
user:updated | OnUserUpdated |
user:deleted | OnUserDeleted |
role:created |
Coveo for Sitecore (October 2016)
OnRoleCreated |
role:deleted |
Coveo for Sitecore (October 2016)
OnRoleDeleted |
roles:usersAdded | OnUsersAddedToRole |
roles:usersRemoved | OnUsersRemovedFromRole |
roles:rolesAdded |
Coveo for Sitecore (October 2016)
OnRolesAddedToRoles |
roles:rolesRemoved |
Coveo for Sitecore (October 2016)
OnRolesRemovedFromRoles |
Hence, in the Coveo.SearchProvider.config
file, the following elements have been added.
Coveo for Sitecore (October 2016)
<events>
...
<event name="user:created">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnUserCreated" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserCreated"/>
</event>
<event name="user:updated">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnUserUpdated" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserUpdated"/>
</event>
<event name="user:deleted">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnUserDeleted" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserDeleted"/>
</event>
<event name="role:created">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnRoleCreated" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRoleCreated"/>
</event>
<event name="role:deleted">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnRoleDeleted" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRoleDeleted"/>
</event>
<event name="roles:usersAdded">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnUsersAddedToRole" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUsersAddedToRole"/>
</event>
<event name="roles:usersRemoved">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnUsersRemovedFromRole" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUsersRemovedFromRole"/>
</event>
<event name="roles:rolesAdded">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnRolesAddedToRoles" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRolesAddedToRoles"/>
</event>
<event name="roles:rolesRemoved">
<handler type="Coveo.SearchProvider.Events.ExpandedPermissionsEventHandler, Coveo.SearchProviderBase" method="OnRolesRemovedFromRoles" />
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRolesRemovedFromRoles"/>
</event>
</events>
<events>
...
<event name="user:created">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserCreated"/>
</event>
<event name="user:updated">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserUpdated"/>
</event>
<event name="user:deleted">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserDeleted"/>
</event>
<event name="role:created">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRoleCreated"/>
</event>
<event name="role:deleted">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRoleDeleted"/>
</event>
<event name="roles:usersAdded">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUsersAddedToRole"/>
</event>
<event name="roles:usersRemoved">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUsersRemovedFromRole"/>
</event>
<event name="roles:rolesAdded">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRolesAddedToRoles"/>
</event>
<event name="roles:rolesRemoved">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnRolesRemovedFromRoles"/>
</event>
</events>
Coveo for Sitecore (October 2016)
<events>
...
<event name="user:created">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserCreated"/>
</event>
<event name="user:updated">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserUpdated"/>
</event>
<event name="user:deleted">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUserDeleted"/>
</event>
<event name="roles:usersAdded">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUsersAddedToRole"/>
</event>
<event name="roles:usersRemoved">
<handler type="Coveo.SearchProvider.Events.EntityEventHandler, Coveo.SearchProviderBase" method="OnUsersRemovedFromRole"/>
</event>
</events>
Manual Update
-
Open the Coveo Search section of the Sitecore Control Panel (see Opening the Coveo Search Control Panel Section).
-
Choose Actions.
-
The Coveo for Sitecore Actions dialog will be displayed.
You may want to either update all the entities in the security cache, or update a specific user or role. Note that the former can be time consuming.
Update All
-
Choose Update All in the Update Security Cache section.
-
Choose Update.
-
The security cache update should have started. Choose Close to close the dialog.
Update User or Role
-
Choose Update User Or Role in the Update Security Cache section.
-
Enter the name of the user or role you want to update, and select the type.
-
Choose Update.
-
The update of the security entity should have started.
If the entity doesn’t exist, or has just been deleted, you have to confirm the operation.