Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6
-
Component/s: Core CiviCRM
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
There have been changes to the way permissions are built up (CRM-16201). I've found related issues but I haven't seen this one yet.
In short: when using CiviCRM with Drupal in another language, all permissions for CiviCRM modules (CiviMember, CiviEvent, etc) are completely cleared and all users lose access to all modules, every time the permissions are rebuilt.
This issue should only affect CiviCRM 4.6 + Drupal.
And this small pull request should fix it (and fixes an 'is not an array' warning while I was at it):
https://github.com/civicrm/civicrm-core/pull/6251
Longer version:
- The Drupal permissions page (admin/people/permissions) fetches permissions with descriptions and saves them correctly in the Drupal role_permission table (eg 'access CiviEvent').
- When the permissions are rebuilt, the assembleBasicPermissions function gets permission info from all enabled modules.
- These are fetched with $descriptions = false. When using CiviCRM in another language, the translated label is used as the array key (eg 'toegang tot CiviEvent => CiviEvent: toegang tot CiviEvent').
- In the Drupal upgradePermissions function, all permissions that do not exist in the array are removed from the role_permission table.
- That means every time an extension or module is installed or the permission info is rebuilt for another reason, all permissions on CiviCRM modules are gone and have to be reconfigured manually.