Problem/Motivation

After adding a Reaction field, site builders must grant view, create and modify permissions before visitors can use it. This requirement is easy to miss, and an open field may appear broken to visitors.

Proposed resolution

When a Reaction field is created, grant the Anonymous and Authenticated roles permission to view, add and modify reactions for that field and bundle. Administrators can revoke these permissions on the Permissions page.

Apply the defaults once when the field is created. Editing the field must respect subsequent permission changes. Existing fields retain their current permissions after a module update.

Remaining tasks

  • Grant the Anonymous and Authenticated roles view, create and modify reaction permissions when a new Reaction field is created.
  • Keep existing fields and permissions unchanged during module updates and configuration imports.
  • Ensure editing a field does not restore permissions an administrator has revoked.
  • Add tests for field creation, permission changes and configuration import.

User interface changes

The relevant permissions will be checked by default for Anonymous and Authenticated users when a new Reaction field is created. Administrators can change them on the Permissions page.

API changes

None anticipated.

Data model changes

Creating a Reaction field will add permissions for that field and bundle to the Anonymous and Authenticated role configuration. Existing fields will retain their current permissions.

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

elaman created an issue. See original summary.

  • elaman committed 75095cf3 on 8.x-1.x
    Issue #3637916: Grant default reaction permissions for new fields
    
elaman’s picture

Assigned: elaman » Unassigned
Status: Active » Fixed

Merged. New reaction fields now grant Anonymous and Authenticated users permission to view, create, and modify reactions by default. Administrators can change those permissions afterward.

Existing field permissions and imported configuration are preserved. Deleting a field also removes its permissions from roles when their field dependencies are recorded.

Tested on Drupal 10 and 11.

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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.