Problem/Motivation

Roles are loaded with overrides in place, changes are made to them and then the combined result is saved back to config. This destroys the original config value.

This was caused when replacing user_role_grant_permissions() so does not need to be ported.

Roles are loaded with overrides in two places:
- cas_server_install()
- ServicesForm::save()

Steps to reproduce

  1. Override a role value eg. $config['user.role.authenticated']['label'] = 'Overridden label'; in settings.php
  2. Install CAS Server 3.0.x
  3. Remove the override from settings.php
  4. Review label for Authenticated role - it should be "Authenticated user" but is still "Overridden label"

Proposed resolution

Load roles with loadOverrideFree() or loadMultipleOverrideFree() before making changes and saving them.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ✅ Automated unit testing coverage
  • ❌ Automated functional testing coverage
  • ❌ UX/UI designer responsibilities
  • ❌ Readability
  • ✅ Accessibility
  • ❌ Performance
  • ✅ Security
  • ❌ Documentation
  • ✅ Code review by maintainers
  • ✅ Full testing and approval
  • ✅ Credit contributors
  • ✅ Release notes snippet
  • ❌ Release

User interface changes

  • N/A

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

Issue fork cas_server-3641389

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

elc created an issue. See original summary.

  • elc committed 1748eb03 on 3.0.x
    fix: #3641389 Save role permissions without config overrides.
    
    By: elc...
elc’s picture

Assigned: elc » Unassigned
Issue summary: View changes
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.