Problem/Motivation
We have some slightly-more-complex-than-usual workflow requirements that state once an author has transitioned a piece of content into the review state, they should not be able to edit it again.
Proposed resolution
To allow this, I propose adding "edit content in X state" permissions. This would give a flexible way for administrators to provide more granular control over each workbench state.
There could potentially be a on/off switch for these permissions in the global workbench settings as to not break existing functionality?
Remaining tasks
Implement.
Tests?
User interface changes
Added permissions and potentially a new configuration item to turn said permissions on.
Comments
Comment #2
acbramley commentedInitial patch to see what breaks.
One thing that is confusing me: I tried to use AccessResult::neutral() in the 2 places where it does the parent::access() call instead as that seems to be what you're supposed to do but that just resulted in access denieds across the board. I've had the same issue before and I'm not sure why.
Comment #3
acbramley commentedLets try that again.
Comment #10
acbramley commentedAdding permissions to the moderation state admin test user.
Comment #11
acbramley commentedComment #12
rooby commentedShouldn't this be handled by the workbench access module?
Comment #13
acbramley commentedThat's a good point, we'll see what the maintainer thinks.
Comment #14
acbramley commentedJust reading the first 2 paras of that module, it doesn't seem to fit this feature request.
This is specifically edit permissions based on workbench state. Nothing to do with hierarchies, sections, etc.
Comment #15
acbramley commentedRerolled against HEAD.
Comment #16
larowlanWe discussed this at DrupalSouth 2016.
I think this code should be a sub-module (or it could even be it's own module).
Mainly because that would give someone the chance to disable it if they didn't want it.
It should slot in on top of existing functionality in its own module.
Also, given we're dealing with access (and therefore security) here, we need tests.
Comment #17
acbramley commentedThanks Lee, looks like there's a couple of 7.x modules out there already so moving to #2824135: Drupal 8 port
Cheers