Problem/Motivation
The 8.x-7.x version of the module defines some permissions which are not defined in the 8.0.x version:
- administer elasticsearch connector
- administer elasticsearch cluster
- administer elasticsearch index
After upgrading the module's code (i.e.: with composer), and running database updates (i.e.: to migrate the configuration to Search Api Servers and Indexes), trying to modify a role that used to have those permissions would result in errors like...
RuntimeException: Adding non-existent permissions to a role is not allowed. The incorrect permissions are "administer elasticsearch cluster", "administer elasticsearch connector", "administer elasticsearch index". in Drupal\user\Entity\Role->calculateDependencies() (line 210 of core/modules/user/src/Entity/Role.php).
... or in some cases, just exporting configuration would result in errors like...
In Role.php line 207:
Adding non-existent permissions to a role is not allowed. The incorrect permissions are "administer elasticsearch cluster", "administer elasticsearch connector", "administer elasticsearch index".
Steps to reproduce
(coming soon)
Proposed resolution
There are similar permissions in search_api, but they grant wider access to add servers/indexes of any type. Instead of replacing the old elasticsearch_connector-7 permissions with the similar-but-broader-scope Search API permissions, a safer solution would be to remove the old elasticsearch_connector-7 permissions during the database update.
Note also that elasticsearch_connector-7 has no usable UI without Search API, so it seems pretty likely to me that users with the old elasticsearch_connector-7 permissions likely also have the equivalent Search API permissions.
We should probably also write a change record for this.
Remaining tasks
- Write a patch
- Review and feedback
- RTBC and feedback
- Write a change record
- Commit and release
User interface changes
None.
API changes
None.
Data model changes
None.