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.
Comments
Comment #2
osopolarComment #3
osopolarComment #4
osopolarComment #5
gislePatch failed to apply. It needs to be rerolled for HEAD.
Comment #6
mrinalini9 CreditAttribution: mrinalini9 at Srijan | A Material+ Company for Drupal India Association commentedComment #7
mrinalini9 CreditAttribution: mrinalini9 at Srijan | A Material+ Company for Drupal India Association commentedRerolled patch for 8.x-1.x, please review.
Comment #8
mrinalini9 CreditAttribution: mrinalini9 at Srijan | A Material+ Company for Drupal India Association commentedComment #9
mrinalini9 CreditAttribution: mrinalini9 at Srijan | A Material+ Company for Drupal India Association commentedPlease ignore patch #7, here is the rerolled patch for 8.x-1.x, please review.
Comment #11
gisleThis is fixed in the latest snapshot 8.x-1.x-dev.