Disabled checkboxes don't get submitted (see https://www.w3.org/TR/html401/interact/forms.html#disabled). This results in that permissions forced by ContentAccessPageForm::forcePermissions() won't actually be set (except the ones set by the process callback disableCheckboxes(). For example I have an editor role which was not set in content-access per-node settings (it was not stored in the content_access table).

Rewriting forcePermissions() to be a process callback instead of an after_build form-callback will make the forced permissions available to values after form submit. Actually I didn't verify how this magic works, but it does work.

Anyway it would be nice if the behavior of forcePermissions() could be documented better. I don't get why a user can only add but not revoke permissions for update(_own) or delete(_own) permission set in the content type access settings. At least in my case the editor roles permission update_own, which where set in the content type access settings where checked but disabled in the per-node access settings.

BTW: For the checkboxes in ContentAccessPageForm::buildForm() the function disableCheckboxes() is called, but in ContentAccessAdminSettingsForm::roleBasedForm() not. Hence the default settings might also be different to the the per-node settings, when just saving the per node settings.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

osopolar created an issue. See original summary.

osopolar’s picture

Title: Behavior of checkboxes should be the same for default settings and per node settings » Default settings should match the per node default settings
Status: Active » Needs review
FileSize
8.4 KB
osopolar’s picture

Issue summary: View changes
gisle’s picture

Status: Needs review » Needs work

Patch failed to apply. It needs to be rerolled for HEAD.

mrinalini9’s picture

Assigned: Unassigned » mrinalini9
mrinalini9’s picture

Rerolled patch for 8.x-1.x, please review.

mrinalini9’s picture

Assigned: Unassigned » mrinalini9
mrinalini9’s picture

Please ignore patch #7, here is the rerolled patch for 8.x-1.x, please review.

  • mrinalini9 authored 973058e on 8.x-1.x
    Issue #2879479 by mrinalini9: Fixed default settings should match the...
gisle’s picture

Status: Needs review » Fixed

This is fixed in the latest snapshot 8.x-1.x-dev.

Status: Fixed » Closed (fixed)

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