I often find it useful to limit who can alter fields through the comment alter functionality vs who must do it through the node edit form. Field permissions can only be used to control who can alter nodes through comments if both methods are controlled the same.

Patch to follow.

Comments

WorldFallz created an issue. See original summary.

WorldFallz’s picture

Status: Active » Needs review
StatusFileSize
new1.26 KB
boobaa’s picture

Status: Needs review » Needs work

I like both the idea and the implementation – could you please also add tests?

nickonom’s picture

We have a use case when the regular users are ok to see what has been altered by editors, but are not allowed to alter fields by themselves.

nickonom’s picture

Since 7.x-1.0-rc4+34-dev lot's of wonderful changes were done, so with the latest git-pulled dev branch the following code in a custom module works just as desired:


if ($form_id == 'comment_node_ticket_form') {
    if (!in_array('administrator', $user->roles)) {
      $form['field_some_field']['#access'] = FALSE;
    }

so I believe there is no need to add permissions anymore.

bluegeek9’s picture

Status: Needs work » Closed (outdated)
//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support makes this project sustainable.
There are multiple ways to show appreciation for the work contributed to this project including:
  • Triage issues and adding more context to existing issues.
  • Flagging Comment Alter as a favorite on the project page to help others discover it and show your support.

Drupal 7 is End of Life. We recommend upgrading to a supported version of Drupal.