1

I have users that need to be able to edit a piece of content they created until the status field on the piece content is updated to a particular value.

I've done some research and it looks like there are questions that are similar to mine but different enough that their solutions don't seem applicable.

I realize this question might be vague but I don't know how else to phrase it.

Are there any solutions to my problem?

Edit: I am using Drupal 7.

2
  • You should let us know what version of Drupal you are using (6,7,8?). It sounds like you may be looking for a workflow solution using something like Workbench, specifically Moderation can be used to set node permissions based on the publication status of a node, but that might be a different kind of "status" than you're talking about.
    – Travis
    Commented Nov 17, 2016 at 14:08
  • The status I'm talking about comes from a select list field on the form. Also I updated the question to include my version of Drupal. Currently looking into workbench!
    – Andrew
    Commented Nov 17, 2016 at 14:32

1 Answer 1

1

I think you can achieve this by implementing hook_node_access() with a check on the particular field.

https://forumone.com/ideas/programmatically-restricting-access-to-drupal-content has a very similar use case (except the field there is an entityreference field to users, but you get the gist)

3
  • This looks great! I'll give it a shot and update when it's done.
    – Andrew
    Commented Nov 17, 2016 at 16:14
  • Can this be applied solely to the edit content instead of blocking node access entirely?
    – Andrew
    Commented Nov 17, 2016 at 16:29
  • As per documentation the $op parameter can be "create", "delete", "update" or "view". So any
    – zerolab
    Commented Nov 17, 2016 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.